30 lines
769 B
HLSL
30 lines
769 B
HLSL
// XC_BUILTIN_UNLIT_D3D12_VS
|
|
cbuffer PerObjectConstants : register(b1) {
|
|
float4x4 gProjectionMatrix;
|
|
float4x4 gViewMatrix;
|
|
float4x4 gModelMatrix;
|
|
float4x4 gNormalMatrix;
|
|
float4 gMainLightDirectionAndIntensity;
|
|
float4 gMainLightColorAndFlags;
|
|
};
|
|
|
|
struct VSInput {
|
|
float3 position : POSITION;
|
|
float3 normal : NORMAL;
|
|
float2 texcoord : TEXCOORD0;
|
|
};
|
|
|
|
struct PSInput {
|
|
float4 position : SV_POSITION;
|
|
float2 texcoord : TEXCOORD0;
|
|
};
|
|
|
|
PSInput MainVS(VSInput input) {
|
|
PSInput output;
|
|
float4 positionWS = mul(gModelMatrix, float4(input.position, 1.0f));
|
|
float4 positionVS = mul(gViewMatrix, positionWS);
|
|
output.position = mul(gProjectionMatrix, positionVS);
|
|
output.texcoord = input.texcoord;
|
|
return output;
|
|
}
|