   Cg Pixel Shader Problem
  Hey there,I just started writing my first pixel shader yesterday and I already ran into a big problem which, even after hours of google searachijg, I just couldn't figure out.i got this incredible shader that is basically supposed to blindly forward any incoming color to its output. looks something like this:OUT.color_out.xyz = IN.color_in.xyz;with those variables bound to COLOR0.now this seems to work perfectly fine with any incoming colour that was set by the application by help of glColor(...). My simple test cube gets displayed nicely.However as soon as i try to display textured surfaces all i get is a completely white fragment as output of the pixel shader.My assumption is that, as soon as I replace the fixed function pipeline with my pixel shader, I also have to worry about texture mapping in my shader, is that correct?If that's the case, how can i just assign the texture value for a texture that is currently bound and enabled by help of the regular opengl commands:glBindTexture(GL_TEXTURE_2D, random_texture_);glEnable(GL_TEXTURE_2D);How can i access this texture in my fragment shader?All i really wanna do in the end is perform a simple lookup-table colour transformation for every incoming pixel. So all i basically need is the exact colour value that would be written to the backbuffer in a regular fixed function pipeline.   
  Last time I checked, the output you get is correct, because you're not using the colour of the texture (uniform sampler2D). For example, if you wanted to create a simple shader (like something GL_MODULATE would produce), you only need to use something like this:typedef struct {  float4 col0 : COLOR0;  float4 tex0 : TEXCOORD0;}FragIn;fragout_float main(FragIn inFrag,uniform sampler2D texture1){  fragout_float outFrag;  outFrag.col = inFrag.col0 * tex2D(texture1,inFrag.tex0.xy);  return outFrag;};  You need to use the commands:  cgGLSetTextureParameter(<CGparameter>, <texture ID>);  cgGLEnableTextureParameter(<CGparameter>);and  cgGLDisableTextureParameter(<CGparameter>);to set your texture aswell.;  damnit, i thought there could be a way where you don't have to explicitly use these cg specific commands to pass the texture. i was really just trying to plugin the raw pixel shader into an existing project to just modify the already computed fragments right before they were written into the backbuffer. i guess i'll have to do bigger modifications then.   ;  meh, im bumping from one problem to the next. i got a shader that looks as follows now:fout main(appdata IN, uniform sampler2D cg_lookup_tex_, uniform sampler2D texture0_){  OUT.color_out.xyz = IN.color_in * tex2D(texture0_, IN.tex_coord.xy );  return OUT;}cg_lookup_tex_ is supposed to be my lookup table (which is not yet used at this point) and texture0_ is the regular texture i wanna enable for a surface. In my application I do the following:// Enable texturesglBindTexture(GL_TEXTURE_2D, cg_test_texture_);cgGLEnableTextureParameter(texture0_);cgGLSetTextureParameter(texture0_, cg_test_texture_);glBindTexture(GL_TEXTURE_2D, cg_lookup_texture_);cgGLEnableTextureParameter(cg_lookup_tex_);cgGLSetTextureParameter(cg_lookup_tex_, cg_lookup_texture_);-> DrawSo i pass 2 different textures to those 2 uniform sampler2D parameters of my shader. However in my shader both of these contain the same texture (I can see that by changing tex2D(texture0_) to tex2D(cg_lookup_tex_)). And its always the one i enabled last in my apllication. Anybody got an idea whats wrong? is it something with the texture units?   