PDA

View Full Version : GLSL gl_FrontFacing errneousley always true?



lasso
09-08-2009, 05:32 AM
Hi,

I'm working with a fragment shader that has run fine on ATI/NVidia on Windows and with NVidia on Mac OS X, but recently discovered that with ATI on Mac OS X (10.5), the gl_FrontFacing variable is always true. I have reported this to Apple, but received no comments. Has anyone else run into this?

(I have also discovered that attempting to use edge flags with glDrawArrays(GL_TRIANGLE,.. ) ATI / Mac OS X is futile..)


Cheers

scratt
09-08-2009, 06:43 AM
I remember this being problematic on the X1600.

Have you tried using GL_VERTEX_PROGRAM_TWO_SIDE_ARB and writing to gl_FrontFacing in the vertex shader? That's a possible work around.

Other than that file a radar with Apple, or mention it on the Apple OpenGL List as Chris and others from ATI tend to lurk there and will reply. :)

lasso
09-08-2009, 10:47 PM
Writing to gl_FrontFacing in the vertex shader? How would I know what to write to it?

I did check out GL_VERTEX_PROGRAM_TWO_SIDE and I figured that I could use the color to code what is front / back as a workaround.

I'll drop a message on the OpenGL list..

scratt
09-09-2009, 04:57 AM
Noticed your post on the list.. Hopefully Chris will respond to you.

I am guessing you've found this and read it..
http://lists.apple.com/archives/mac-opengl/2009/Mar/msg00001.html

That was kind of what I was referring to in the post above. I meant of course to use the colours but my fingers got ahead of my brain!!. :)

lasso
09-09-2009, 02:50 PM
Thanks for the advice to post on mac-openl scratt! ATI are helping me out now.

I successfully implemented a workaround with secondary back and front colors for gl_FrontFacing emulation that works great. The edgeflags thing was a confirmed bug.

scratt
09-10-2009, 02:09 AM
No worries. For all their little niggles with drivers ATI seem far more responsive and genuinely concerned about issues than any other vendor. Glad you got some help. :)