FBO - shadow mapping

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 :slight_smile:

You can use glViewport() to restrict rendering to part of an FBO.

Wouldn’t it be glScissors()?

Oh, yes of course! Sorry for the confusion.

glViewport() did the trick, thank you very much. I’ll read a bit about glScissors also :stuck_out_tongue:

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.