kimziv / oglsuperbible5

GLTools and OpenGL SuperBible (5th Edition) OpenGL超级宝典第五版
41 stars 16 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 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