Original Post
Hey All. I'm a little confuzled about the specifics of parameter shadowing in Cg + OpenGL. I've read the Cg documentation, and that essentially says that Cg keeps an internal variable, with the value that you assign. So, you assign the parameter, and it sticks. Now, surely, you can re-assign that parameter? So, for instance, say I wanted to set a parameter ( a uniform colour for instance ), draw something, then set that parameter to something else ( a different colour ), and draw something else... Would this work? I looked at the sample CgGL runtime code in the docs, and it has this:
// Set parameters that don't change:
// They can be set only once because of parameter shadowing.
cgGLSetTextureParameter(baseTexture, texture);
cgGLSetParameter4fv(someColor, constantColor); Does that mean that the parameters baseTexture and someColor cannot change beyond this point, even if another call to cgGLSetParameter4fv is called, for instance? This basically has rather large rammifications on my handling of parameters/uniform variables in my engine, and depending on whether I can re-assign variables decides on which path I take. Thanks all.