This line,
+= gl_FrontMaterial.specular
                        * gl_LightSource[0].specular
                        * pow(NdotHV, (gl_FrontMaterial.shininess/128.0));


Where is NdotHV, being set? Its defined as a float, but never set to a value, which means it is probably defaulting to 0, and therefor setting the result of the line above to 0, so you are not adding any contribution? I assume this is (by the variable name) the dot product of the half vector (float) as it is defined, but it is never being calculated. Is that the issue?

I added this line:

                NdotHV = dot(halfV, n);

just above the the first quoted line, and all seems to work here..



On May 27, 2008, at 12:01 PM, Alex Drinkwater wrote:

I'm trying to implement a really basic Phong Directional GLSL shader inside a Lighting environment patch, and have been having problems getting the specular contribution to work.


 _______________________________________________
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