Jump to content
  • Advertisement
Sign in to follow this  
KDSBest

Shadow Map

This topic is 4186 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!