I am trying to give realistic depth for my rendered cube instead of one color depth. I have something like:
struct VS_IN
{
float4 pos : POSITION;
float3 Normal : NORMAL; // Normal - for lighting
float4 col : COLOR;
float2 TextureUV: TEXCOORD; // Texture UV coordinate
};
struct PS_IN
{
float4 pos : SV_POSITION;
float4 col : COLOR;
float2 TextureUV: TEXCOORD;
float3 WorldNormal : NORMAL;
float3 WorldPosition : WORLDPOS;
};
float4x4 worldViewProj;
PS_IN VS( VS_IN input )
{
PS_IN output = (PS_IN)0;
output.pos = mul(input.pos, worldViewProj);
output.col = input.col;
output.TextureUV = input.TextureUV;
return output;
}
float4 PS( PS_IN input ) : SV_Target
{
return input.col;
}
I want to obtain something like: