Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Texture2DArray vs CubeMap

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    24

    Texture2DArray vs CubeMap

    Hi,

    I'm working on some cascaded shadow mapping algorithm. For now, I'm using 4 cascades, layout as a 4 texture atlas in a single texture. This works fine, but is limited to 2048*2048 for each cascade, and 4 cascades max.

    I would like to switch to another implementation, with 6 cascades, and I can't use a single texture anymore. So here are my questions :

    - is there any easy way to sample a specific face of a cube map in GLSL ? Something like textureCube(vec2 coords, int faceIndex) ?
    - is there any performance reason to prefer using CubeMap or Texture2DArray ?

    Thanks

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,224
    Quote Originally Posted by Aurelien View Post
    ...cascaded shadow mapping algorithm. ...would like to switch to ... 6 cascades, and I can't use a single texture anymore.

    So here are my questions :

    - is there any easy way to sample a specific face of a cube map in GLSL ? Something like textureCube(vec2 coords, int faceIndex) ?
    - is there any performance reason to prefer using CubeMap or Texture2DArray ?
    To #1, yes. But since you don't need cross-face filtering and access using a direction vector, why use cube maps?

    To #2, don't know, but a 2D texture array makes more sense here and performs well.

  3. #3
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    783
    Any reason you can't just make a 2048 x 2048 x 6 2DArray texture?

    In my experience, every driver that supports array textures also supports NPOT textures.

  4. #4
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    24
    Thanks for your answers.

    The only reason why I'm asking this is about performances, I've experienced slow texture array access in the past, but it was with older GPUs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •