Shadow maps without border color

Hi everyone,

in GL3 border colors other than 0 got deprecated. For shadow mapping it was very common to set the border color of the shadow map to 1.0 so that the distance outside the shadow map is always “infinite”. What do you think is the best way to solve this with GL3? Just reverse the depth comparison?

Thanks in advance.

A quick and easy way is to just set the viewport and scissor testing so that it leaves a one pixel border previously set to infinity.

However one should probably spend some time and make it so you don’t have to use that method, it should be pretty simple to solve with shaders.

in GL3 border colors other than 0 got deprecated.

Wrong. A border width other than 0 is deprecated, meaning: There is no support for border texels anymore.

But a single border color is still supported in GL3!

Additionally, GL_CLAMP got deprecated. You can still use GL_CLAMP_TO_BORDER, though.

I just reread the section and have to admit that you are absolutely right! I was already wondering why border colors would be deprecated when DX10 still has them but now it makes sense…

Thanks for the answers!