Sign in to follow this  
E Nomine

Shadow mapping problems

Recommended Posts

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

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

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