Shadow map arrays - appropriate data structures and functions?

Started by
1 comment, last by mv348 11 years, 7 months ago
So the tutorial I followed for single shadow mapping uses the following datastructures/functions:

1. Shadow map data type (OpenGL): 2D texture (bound to FBO)
2. Shadow Map data type (GLSL): uniform sampler2DShadow
3. Function to lookup shadow data (GLSL): texture( ) // standard GLSL function

But the tutorial for cascaded shadows (which I'm trying to setup) uses the following:

1. Shadow map data type (OpenGL): 3D texture (bound to FBO)
2. Shadow Map data type (GLSL): uniform sampler2DArray
3. Function to lookup shadow data (GLSL): texture2DArray( )

Now the first tutorial is significantly more recent, and reflects how my code is currently set up. So I was wondering what is an appropriate way to adapt for multiple shadow maps while maintaining the style of the first approach?

Is there such a thing as a sampler2DShadowArray? (I couldn't find this via googling but perhaps it has another name)
Advertisement
Could you post a link to the tutorial in question?

+---------------------------------------------------------------------+

| Game Dev video tutorials -> http://www.youtube.com/goranmilovano | +---------------------------------------------------------------------+
The first tutorial (regular shadow mapping) is here but you'll have to scroll down to "Stratified Poisson Sampling" to see fragment shader code as it appears in the accompanying source code (It uses the 'texture' function, rather than the 'texture2D' function.

The second tutorial (cascaded shadow maps) is here but if you choose to look at the accompanying source code, there are a variety of shaders saved because the program lets you choose your fragment shader for a variety of options. The best one to look at would be "shadow_multi_leak_fragment.glsl".

Thanks!

This topic is closed to new replies.

Advertisement