Results 1 to 4 of 4

Thread: Rendering to different locations in texture

  1. #1
    Member Newbie
    Join Date
    Feb 2014
    Location
    Poland
    Posts
    44

    Rendering to different locations in texture

    Hello.

    For purposes of shading (and shadow mapping in this case) I need to pass multiple shadow maps to a shader. Using many texture slots can quickly drain all the available resources, so I guessed it's much better to pass one, bigger texture that would contain all the shadow maps layed after eachother in a rectangles let's say 800x600.
    So here comes my question: how to dynamically change viewport for rendering to texture? Something like shifting the viewport's X and Width values for some constant value.

    I've read about that geometry shader can do something like this, but isn't it an overkill? I have the whole scene, I got the texture, and using a whole additional shader stage just to change viewport seemed a bit overcomplicated to me.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649
    Use texture arrays as a primary, or texture atlases (as you allude to) as a fallback plan. See this thread. You can do a pass per shadow map, or one pass for all maps. If you chose the latter (layered rendering), see the wiki for info on having separate viewports per layer.

  3. #3
    Member Newbie
    Join Date
    Feb 2014
    Location
    Poland
    Posts
    44
    So basically I can use glFramebufferTextureLayer with texture array, right? I didn't know theese two can be combined. I guess that solves my problems. Thank you for pointing me at right direction!

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649
    Yes, if you want to use layered rendering.

Similar Threads

  1. Rendering the same polygon at different locations
    By jas511 in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-17-2011, 11:21 PM
  2. spatial locations
    By cnone in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-20-2009, 01:25 PM
  3. Getting Uniform Locations
    By Dtag in forum OpenGL: GLSL
    Replies: 5
    Last Post: 12-31-2003, 08:45 AM
  4. glut32.dll in multiple locations
    By ChrisS in forum OpenGL: User Software
    Replies: 1
    Last Post: 07-06-2001, 03:22 AM
  5. glut32.dll in multiple locations
    By ChrisS in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-05-2001, 07:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean