Sign in to follow this  
polyfrag

Stencil shadows not working

Recommended Posts

[url="http://www.gamedev.net/topic/631073-glsl-shadows-not-working/page__p__4978508#entry4978508"]Double post [/url][img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img]

Programming != Copy'n'Paste

Share this post


Link to post
Share on other sites
Fixed, I didn't know that the model texture was interfering with the shadow map.

Now I use multi-texturing:

[code]glActiveTextureARB(GL_TEXTURE0_ARB);
glUniform1iARB( texture1, 0 );
glActiveTextureARB(GL_TEXTURE1_ARB);
glUniform1iARB( texture2, 1 );
glActiveTextureARB(GL_TEXTURE2_ARB);
glUniform1iARB( shadowMap, 2 );[/code]

Share this post


Link to post
Share on other sites
Oh, fixed. I had to do this before rendering text:

[code]
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, NULL);

glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, NULL);

glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, NULL);
[/code] Edited by polyfrag

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