This topic is now archived and is closed to further replies.

tex2D(decal, texCoord);

This topic is 5010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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: TEXCOORD0 Now, 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... Salsa cooked it, your eyes eat it!
[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

Share this post

Link to post
Share on other sites