Kav/Effects/HLSL/SimpleDepthEffect.fx

45 lines
760 B
Plaintext
Raw Normal View History

2020-08-07 00:58:50 +00:00
#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;
2020-08-07 00:58:50 +00:00
};
VertexShaderOutput main_vs(VertexShaderInput input)
{
VertexShaderOutput output;
output.Position = mul(input.Position, ModelViewProjection);
output.Depth = output.Position.z;
2020-08-07 00:58:50 +00:00
return output;
}
float4 main_ps(VertexShaderOutput input) : SV_TARGET0
{
return float4(input.Depth, 0.0, 0.0, 0.0);
}
2020-08-07 00:58:50 +00:00
Technique SimpleDepth
{
Pass
{
VertexShader = compile vs_3_0 main_vs();
PixelShader = compile ps_3_0 main_ps();
2020-08-07 00:58:50 +00:00
}
}