Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Phong Lighting in Lighting/GLSL Patches



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@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden

References: 
 >Phong Lighting in Lighting/GLSL Patches (From: Alex Drinkwater <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.