*
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#pragma shader_language HLSL
|
||||
|
||||
#include <Shaders/test0.hlsl>
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float4 inPosition : POSITION;
|
||||
float3 inColor : NORMAL;
|
||||
float2 uv0 : UV0;
|
||||
float2 uv1 : UV1;
|
||||
};
|
||||
|
||||
struct VS_OUTPUT {
|
||||
float4 vPosition : SV_POSITION;
|
||||
float3 color;
|
||||
};
|
||||
|
||||
|
||||
#ifdef SHADER_STAGE_VERTEX
|
||||
cbuffer CameraData : register(b0, space0) {
|
||||
float4x4 view;
|
||||
float4x4 proj;
|
||||
float4x4 viewproj;
|
||||
}
|
||||
|
||||
|
||||
struct Test {
|
||||
float3 getColor() {
|
||||
return float3(1,0,0);
|
||||
}
|
||||
};
|
||||
|
||||
VS_OUTPUT main(VS_INPUT v, uint VertexIndex : SV_VertexID) {
|
||||
VS_OUTPUT o;
|
||||
Test t;
|
||||
float4x4 vp = mul(view, proj);
|
||||
o.vPosition = mul(float4(v.inPosition.xyz, 1), vp);
|
||||
o.color = v.inColor;
|
||||
return o;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SHADER_STAGE_FRAGMENT
|
||||
float4 main(VS_OUTPUT input) : SV_Target
|
||||
{
|
||||
return float4(input.color, 1.0f);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user