ATI_fragment_shader + GL_ARB_multitex ... problem

Started by
1 comment, last by np39223 17 years, 6 months ago
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.

   //////////////////////////////////////////////////////////////
   /// Loading texture - At least trying to:)
  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);
  /////////////////////////////////////////////////////////////////////

  ////////////////////////////////////////////////////////////////
  /// initializing ATI_fragment_shader
  fragShaderName = glGenFragmentShadersATI(1);
  glEnable(GL_FRAGMENT_SHADER_ATI);
  glBindFragmentShaderATI(fragShaderName);

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

  /////////////////////////////////////////////////////////////////
  ///drawing geometry
  glEnable(GL_TEXTURE_2D);
  glBindTexture(GL_TEXTURE_2D, texture[0]);
  glBegin(GL_QUADS);
    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!
Advertisement
set the uniform! see the other thread you mentioned
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...

This topic is closed to new replies.

Advertisement