PDA

View Full Version : FBO - shadow mapping



Live_MusIc
01-09-2012, 11:38 AM
Hi. Im having some trouble with artifacts that get generated when I map the shadowmap stored in an FBO to the scene. Specifically, the problem is that I use GL_CLAMP to do the mapping and when an object touches the border of the texture the shadow gets repeated.
Is there a way to write to FBO, but leaving the borders of the binded texture untouched? (So GL_CLAMP wont repeat garbage when an object touches it)
Thanks, and sry for my english :)

carsten neumann
01-09-2012, 11:53 AM
You can use glViewport() to restrict rendering to part of an FBO.

Zyx_2000
01-09-2012, 02:04 PM
Wouldn't it be glScissors()?

carsten neumann
01-09-2012, 02:19 PM
Oh, yes of course! Sorry for the confusion.

Live_MusIc
01-09-2012, 02:44 PM
glViewport() did the trick, thank you very much. I'll read a bit about glScissors also :p

Live_MusIc
01-09-2012, 03:08 PM
It seems the correct one is glScissors(), however since the FBO size is big it won't make too much of a difference. Thanks again.