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

Thread: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

  1. #1
    Intern Contributor
    Join Date
    Feb 2006
    Posts
    62

    "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    I want to use the depth to set fragment color....


    I have tried
    Code :
    gl_FragColor = vec4(gl_FragDepth, 0.0, 0.0, 1.0);
    but when I run my app, I get the following:

    "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    I thought gl_FragDepth was a valid variable....

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,052

    Re: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    And your hardware and driver is... ?
    GLIM - Immediate Mode Emulation for GL3

  3. #3
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,119

    Re: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    gl_FragDepth is write-only.

  4. #4
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    i believe gl_FragDepth is what u write the output depth value u want to
    if u wanna access the current depth value (interpoltaed from the vs) use gl_FragCoord.z

  5. #5
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,119

    Re: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    A little correction:
    gl_FragDepth is write-only.
    Well, you can read it, but only after you have written something into it.

  6. #6
    Intern Newbie
    Join Date
    Sep 2004
    Posts
    40

    Re: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    Somewhat related to this, when I try to read from gl_FragCoord I get some weird flicker of death, nothing gets rendered and it seems as if the rendering context goes out of whack, glIntercept reveals no issues.

    The rather startling thing is that another shader (not coded by me) that uses it in a far more complex manner works fine.

    ATI radeon 9600 pro, and catalyst drivers that are no more than 2 months old, I'll get some new ones to be sure.

  7. #7
    Intern Newbie
    Join Date
    Sep 2004
    Posts
    40

    Re: "warning C7506: OpenGL does not define the global variable gl_FragDepth"

    Unfortunately, using catalyst 6.4 drivers don't help. Can anyone confirm any strange behaviour when trying to read from gl_FragCoord (I can't do anything at all with it)?

Posting Permissions

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