Sign in to follow this  

ATI_fragment_shader + GL_ARB_multitex ... problem

This topic is 4091 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

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!

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

This topic is 4091 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this