PDA

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



CelticDaddio
05-04-2006, 02:48 PM
I want to use the depth to set fragment color....


I have tried

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

Jan
05-04-2006, 03:00 PM
And your hardware and driver is... ?

k_szczech
05-04-2006, 03:32 PM
gl_FragDepth is write-only.

zed
05-04-2006, 03:34 PM
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

k_szczech
05-04-2006, 03:40 PM
A little correction:

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

qorpse
05-15-2006, 02:25 PM
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.

qorpse
05-15-2006, 04:59 PM
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)?