# ATI_fragment_shader + GL_ARB_multitex ... problem

## Recommended Posts

I'm new to ATI_fragment_shader. I've got a problem similar as Dragon's Strike from "texture 1+ doesnt work in shader". I can only get GL_TEXTURE0(default) to shader(ATI_fragment_shader). When I try to send GL_TEXTURE1+ to GL_REG_0_ATI it renders only black screen.
   //////////////////////////////////////////////////////////////
glGenTextures(1, &texture[0]);
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 4, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE,       pixelsRGBA);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
/////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////

/// it does nothing, I was trying to see can I get something to
glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE1, GL_SWIZZLE_STR_ATI);
////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////
///drawing geometry
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f);
//etc..
/////////////////////////////////////////


So problem is when I use glSampleMapATI(GL_REG_0_ATI, GL_TEXTURE0, GL_SWIZZLE_STR_ATI); it renders fine but when i put GL_TEXTURE1+ instead I get only black screen. I don't now where is the problem. Maybe I haven't bind texture corectly or something? It's killing me because I'm wasting time and I don't have a clue!

##### Share on other sites
set the uniform! see the other thread you mentioned

##### Share on other sites
Sorry if I sound retarded but that stuff about uniforms, is it GLSL related? I'm not using GLSL because it's unsupported by my hardware and I want maximum compatibility so I use only low-level API, which requires GL_ATI_fragment_shader and GL_ARB_multitexturing. I was looking at some older code with frag. shaders and havent found that uniforms...

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627731
• Total Posts
2978831

• 10
• 9
• 21
• 14
• 12