Anyone managed to get 2-sided GLSL lighting working in QC? I'm actually trying to implement a very simple 'fake' lighting effect in a GLSL Shader patch, whereby the colour at each fragment is a product of it's distance from an arbitrary light-source position. I have this working already, but I'd like to be able to shade the front and back-facing sides of a mesh with different base-colours.

I've tried using
gl_FrontColor
and
gl_BackColor
set to different colours in the Vertex Shader, but the front color is always used for both faces, even if I embed the GLSL Shader patch inside a Lighting Patch with the 'Use 2-sided lighting' option enabled.

2-sided lighting doesn't deal with gl_BackColor, it only determines whether or not certain lighting calculations are performed on non- front-facing polys. If it were to set gl_BackColor, there'd have to be another input somewhere to control it (gltools feature request? ;)

You can see the effects of it here -- 2 teapots, both with front- facing polygons culled. The left one is "normal" lighting, the second is "2-sided". Otherwise, they're identical. Note the inner specular highlights on the right teapot -- that's what this does.

<<inline: Picture 9.jpg>>





--
[ christopher wright ]
[EMAIL PROTECTED]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to