45 lines
760 B
HLSL
45 lines
760 B
HLSL
#include "Macros.fxh"
|
|
|
|
BEGIN_CONSTANTS
|
|
|
|
float4x4 ModelViewProjection _vs(c0) _cb(c0);
|
|
|
|
MATRIX_CONSTANTS
|
|
|
|
END_CONSTANTS
|
|
|
|
struct VertexShaderInput
|
|
{
|
|
float4 Position : POSITION;
|
|
};
|
|
|
|
struct VertexShaderOutput
|
|
{
|
|
float4 Position : SV_Position;
|
|
float Depth : TEXCOORD0;
|
|
};
|
|
|
|
VertexShaderOutput main_vs(VertexShaderInput input)
|
|
{
|
|
VertexShaderOutput output;
|
|
|
|
output.Position = mul(input.Position, ModelViewProjection);
|
|
output.Depth = output.Position.z;
|
|
|
|
return output;
|
|
}
|
|
|
|
float4 main_ps(VertexShaderOutput input) : SV_TARGET0
|
|
{
|
|
return float4(input.Depth, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
Technique SimpleDepth
|
|
{
|
|
Pass
|
|
{
|
|
VertexShader = compile vs_3_0 main_vs();
|
|
PixelShader = compile ps_3_0 main_ps();
|
|
}
|
|
}
|