// This Vertex shader code is used to write to the depth buffer:
/////////////////////////////////////
// Vertex Shader
/////////////////////////////////////
PSInputShadow3 VS_Main_Shadow3( float4 InPos : POSITION )
{
SPSInputShadow3 Out = (SPSInputShadow3)0;
Out.Pos = mul( InPos, LightWVPMat );
Out.Pos.z /= MaxLightRange;
// The MaxLightRange is 500, which is the lights far clip
return Out;
}
// I've had to do this pixel/fragment shader because i'm using shader v3.0
/////////////////////////////////////
// Pixel Shader
/////////////////////////////////////
float4 PS_Main_Shadow3( PSInputShadow3 Input ) : COLOR
{
return float4( 0, 0, 0, 0 );
}
All objects are shadowed when using MAKEFOURCC('D','F','2','4')
Hi,
I'm having a similar problem to the guy in http://www.gamedev.net/community/forums/topic.asp?topic_id=433890.
The issue with my program is that it casts a shadow onto the whole of the object but also the right shadow is cast behind the objects. I've been able to output the shadow depth buffer to an image and i've noticed that the image only contains two colours, black and white. So now it's obvious why the objects are being shadowed.
I've done shadow mapping before using the method where the depth is written to a render target, this works, and when i output the shadow depth buffer i get a nice depth image.
Here's some code:
Anyone know where i could be going wrong?
Thanks
Ankur
I've never worked with that ATI extension, but I'd suggest that you check the values more carefully. It may be that the black/white in your saved image is simply a clipped version of a wider range of values. Try saving into a float DDS image, or getting the value to the CPU side and checking them there.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement