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 2 of 2

Thread: getting texture dimensions from inside a shader

  1. #1
    Intern Contributor
    Join Date
    Oct 2012
    Posts
    53

    getting texture dimensions from inside a shader

    HI

    I would like to get texture's width height and depth from within the shader. Is that possible? I read some previous posts on how there is no way to do this except sending the dimension values as uniform variables into the shader. Is this still the case?

    I have code where the texture is bound to a texture unit in a different location and then the shader's sampler is attached to the texture unit (all the shader binding etc in a different location). I would like to keep all things together instead of decoupling properties of a texture in different variables, samplers etc in different locations and then loosing track of these and messing up.

    thanks!

  2. #2
    Junior Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    213

Tags for this Thread

Posting Permissions

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