Jump to content

  • Log In with Google      Sign In   
  • Create Account


Shadow map arrays - appropriate data structures and functions?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 mv348   Members   -  Reputation: 249

Like
0Likes
Like

Posted 27 September 2012 - 09:05 PM

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)

Edited by mv348, 27 September 2012 - 09:06 PM.


Sponsor:

#2 Goran Milovanovic   Members   -  Reputation: 1104

Like
0Likes
Like

Posted 27 September 2012 - 11:06 PM

Could you post a link to the tutorial in question?

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

| Game Dev video tutorials  ->   http://www.youtube.com/goranmilovano |
+---------------------------------------------------------------------+

#3 mv348   Members   -  Reputation: 249

Like
0Likes
Like

Posted 28 September 2012 - 10:57 AM

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!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS