• Advertisement
Sign in to follow this  

Shadow mapping problems

This topic is 509 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

Advertisement

You need to use a orthagonal projection rather than perspective for shadow buffer a starting point.

The rest looks about right though for using the wrong projection.

 

edit: Ughh...didnt look at the backface of the box, must of been drunk that day.  Apologies.

Edited by ErnieDingo

Share this post


Link to post
Share on other sites

Did You post your shader code somewhere? It looks like you're rendering the shadow map correctly, so I suspect you've made a mistake when you sample the shadow map and do the depth comparison. 

Share this post


Link to post
Share on other sites

Did You post your shader code somewhere? It looks like you're rendering the shadow map correctly, so I suspect you've made a mistake when you sample the shadow map and do the depth comparison. 

Yes, here: http://pastebin.com/AZGMmLb2

Edited by E Nomine

Share this post


Link to post
Share on other sites

didint took a deep look into the codew but you could also you something like normals for each vertex that will interpolate a produce additional mask like:

	if (dot( normalize( vectorAB(light_pos, world_vertex_pos) ), VertexNormal) >= 0.0)
		color = vec4(0.0, 0.0, 0.0, 1.0);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement