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: what is need of integer and SNORM textures

  1. #1
    Junior Member Regular Contributor
    Join Date
    Jun 2012
    Posts
    207

    what is need of integer and SNORM textures

    What is the advantage or need of integer and SNORM textures? when do we use (-1,0) range for textures? Any example where we need specifically integer or SNORM textures?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,212
    SNORM textures don't go {-1, 0}, they go {-1, 1}: https://www.opengl.org/registry/spec...ture_snorm.txt

    This extension provides a set of new "signed normalized" integer texture formats. These are taken to represent a floating-point value in the range [-1.0,1.0] with an exact 0.0.
    You'd use this for e.g storing normals in a g-buffer (the guaranteed exact 0 is useful here).

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2012
    Posts
    207
    and what about integer textures? when do we need those specifically?

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,212
    One example that goes way back is a D24S8 depth texture stores depth as an integer. That aside, it's just functionality; you may as well ask "why do we need an integer data type in C?" and the answer will be the same - for times when you need to use an integer. So if you're implementing an algorithm and that algorithm needs an integer at some point then you may wish to use an integer texture. But it all depends on the algorithm you're implementing.

Posting Permissions

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