PDA

View Full Version : Shadow maps without border color



LaBasX2
04-12-2009, 02:22 AM
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.

zeoverlord
04-12-2009, 03:49 AM
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.

skynet
04-12-2009, 04:41 AM
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.

LaBasX2
04-12-2009, 05:21 AM
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!
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!