iwillburnyou / oglsuperbible5

Automatically exported from code.google.com/p/oglsuperbible5
0 stars 0 forks source link

ADSGouraud demo doesn't actually use specular material component #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Change the specular colour in the ADSGouraud cpp program (eg to red)
2. Run

What is the expected output? What do you see instead?
Specular highlight is white. 

Please provide any additional information below.
Simple fix - the vertex shader doesn't actually use the specular uniform
Change line 51 of ADSGouraud.vp from:
vVaryingColor.rgb += vec3(fSpec, fSpec, fSpec);
to:
vVaryingColor.rgb += fSpec * specularColor.rgb;

(This typo is also in the listing in the book)

Original issue reported on code.google.com by daniel.l...@gmail.com on 26 Nov 2010 at 10:35