rswinkle / oglsuperbible5

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

Chapter 6: Dissolve example broken #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
glUniform1i(locTexture, 1);

from Dissolve.cpp should be:

glUniform1i(locTexture, 0);//we use texture unit zero!

Also, the fragment shader samples the texture, discards the texel if needed, 
but never applies the sampled texture color to the texel, hence, one must add 
this line:
vFragColor *= texture(cloudTexture, vVaryingTexCoord);

after the code that applies the ambient and diffuse colors for the texture to 
be able to appear on screen at all.

Original issue reported on code.google.com by r45...@gmail.com on 3 Jul 2011 at 1:09

GoogleCodeExporter commented 8 years ago
vFragColor *= texture(cloudTexture, vVaryingTexCoord);

I think this is not necessary, because the example wanted to show also that 
textures can be used as data and not only as image to bound to a triangle. And 
the effect done is spectacular even without the line you proposed to add.

Original comment by matteo....@gmail.com on 22 Aug 2011 at 1:02