I'm following this tutorial:
http://www.gamedev.net/reference/articles/article1903.asp
but there are a few things not clear..
for every vertex in the triangle { // Bind the light vector to COLOR0 and interpolate // it across the edge glColor3f([lightx], [lighty], [lightz]);
The fragment shader needs the light vector as input, and here it seems it is passed with glColor.. is it something like a trick or there's a meaning I can't understand?
Moreover, the comment says "interpolate".. what does it mean? The shader will receive the light vector for each vertex and will it automatically interpolate this vector along each edge of the triangles?
About texture management you suggested the method
cgGLSetTextureParameter3fv
to bind the bump texture, but in that piece of code it isn't used, while there's:
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, material.getNormalmapHandle());
glMultiTexCoord2fARB(.glMultiTexCoord2fARB(GL_TEXTURE0_ARB,
texture[Vector::X], texture[Vector::Y]);
Is it the same?
There's also this method:
glSecondaryColor3fvEXT
I looked it up with google and on the opengl website, but found nothing: isn't it commonly used? It isn't even present in the CG Reference Manual..
Sorry for the mess of arguments, but for example, regarding the question of the interpolation, where am I supposed to get information?
In Cg-2.2_April2009_ReferenceManual.pdf, pag. 614, there's a table about "VARYING INPUT SEMANTICS - Interpolated Input Semantics", but it's not really explained..
Thanks.