Minor - Depth shader - V10.6.0

This commit is contained in:
2025-05-28 13:24:53 +02:00
parent f20adee22f
commit 1af71960c3
3 changed files with 28 additions and 58 deletions

View File

@@ -18,11 +18,7 @@ struct PixelInputType
////////////////////////////////////////////////////////////////////////////////
float4 DepthPixelShader(PixelInputType input) : SV_TARGET
{
float4 textureColor;
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
textureColor = shaderTexture.Sample(SampleType, input.tex);
return textureColor;
float depth = input.position.z / input.position.w;
depth = 1.0f - depth;
return float4(depth, depth, depth, 1.0f);
}