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

Thread: Depth textures

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

    Depth textures

    I have implemented depth texture and getting different outputs on 2 different drivers.
    I am reading all channels in texture() in fragment shader :

    “color = color + texelFetch(tk_diffuseMap, ivec3(tmp), i);”

    In this case I get a red and grey image on A and B respectively. If I read red channel and replicate it to all the 4 channels I get a grey image on A like:

    “color = color + vec4(texelFetch(tk_diffuseMap, ivec3(tmp), i).x)”.

    Which one is correct?

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    672
    This depends on your context version, profile, and possibly DEPTH_TEXTURE_MODE.

    In Compatibility profile, or in an ancient GL2 context, DEPTH_TEXTURE_MODE defaults to LUMINANCE, so the expected result is grey.
    In Core Profile, LUMINANCE and DEPTH_TEXTURE_MODE are deprecated, so the expected result is red.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2012
    Posts
    101
    Quote Originally Posted by arekkusu View Post
    This depends on your context version, profile, and possibly DEPTH_TEXTURE_MODE.

    In Compatibility profile, or in an ancient GL2 context, DEPTH_TEXTURE_MODE defaults to LUMINANCE, so the expected result is grey.
    In Core Profile, LUMINANCE and DEPTH_TEXTURE_MODE are deprecated, so the expected result is red.
    Thanks. I am using core profile which means it should be red.

Posting Permissions

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