Sign in to follow this  
KDSBest

Shadow Map

Recommended Posts

Hi, i rendered my shadow map with that shaders.
void main(	in float4 position : POSITION,
		out float4 positionOUT : POSITION,
		out float3 lightVector : TEXCOORD0,
		uniform float4 lightPosition,
		const uniform float4x4 model_view_projection_matrix)
{
	positionOUT = mul(model_view_projection_matrix, position);
	lightVector = lightPosition.xyz -  (position.xyz);
}
void main(
		in float4 positionOUT : POSITION,
		in float4 lightVector : TEXCOORD0,
		out float4 color : COLOR
)
{
	float fDepth = dot(lightVector, lightVector);
	color = float4(floor(fDepth) / 256.0, frac(fDepth), frac(fDepth), frac(fDepth));
}
The Result looks like this: http://img404.imageshack.us/img404/9282/shadowmapft0.jpg It is just a plane on the floor and a cube nearer to the light. Is this right??? Because my calculation is wrong. I rendered 6 sides with my FBO Cube Map and do everything like GPU Gems said. My only Question is: Is the look of the Shadow map Right??? If No, what can be wrong? [Edited by - KDSBest on April 7, 2007 12:43:17 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this