   tex2D(decal, texCoord);
  hmm...ok, that is a line of code taken from the book "The Cg Tutorial", which I''m slowly learning/ decyphering...Now, from what I gather, tex2D functions like a pointer to a x/y coordinate in a texture, and returns the RGB value (alpha too?), right? something along those lines...Now, "decal" is declared as:uniform sampler2D decal...and "texCoord" is declared as:float2 texCoord: TEXCOORD0Now, I''m guessin we use "texCoord" as the xy pointer, and "decal" as the variable that defines which texture we are pointing into, right?Unfortunatly the book doesnt define the engine coding side very well, only the shader coding...So, I''m led to believe we need to setup "decal" on our C++ engine, but how?Also, what is the best place for Cg tutorials, other than nVidia?Thanks for any pointers on this...   [Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][My DevDiary][Yann  L.][Enginuity]  [Penny Arcade]  [MSDN][VS  RoadMap][Humus][BSPs][UGP][NeHe] Prozak - The GameDever formally known as pentium3id 
  Use TEXUNITx to bind a sampler to a unit, for example:uniform sampler2D decal : TEXUNIT0;In your main program you bind a texture to unit 0 and ''decal'' will refer to that one.   Perl - Made by Idiots, Java - Made for Idiots, C++ - Envied by Idiotshttp://sunray.cplusplus.se - http://cplusplus.se