http://www.riemers.net/eng/Tutorials/XN ... ow_map.php
here is the shader code that Im using, the frame work I have works good with other shaders like blur ect, but if I do the code below just a black screen? Does any body have a shader example that renders a depth map for irrlicht?
depth.hlsl
Code: Select all
float4x4 mWorldViewProj;
struct VS_OUTPUT
{
float4 Pos : POSITION;
float3 Pos2d : TEXCOORD0;
};
VS_OUTPUT vertexMain( in float4 Pos : POSITION)
{
VS_OUTPUT Out;
Out.Pos = mul(Pos,mWorldViewProj);
Out.Pos2d = Out.Pos;
return Out;
}
struct PS_OUTPUT
{
float4 RGBColor : COLOR0; // Pixel color
};
PS_OUTPUT pixelMain( VS_OUTPUT PSIn)
{
PS_OUTPUT Output;
Output.RGBColor = PSIn.Pos2d.z/40;
//Even If I Do
//Output.RGBColor = (1,1,1,1);
//I Still get a black screen!! Shouldn't it be white?
return Output;
}
Is there another way to render the depth map in Irrlicht
Please Help:)