cube and sphere mapping OpenGL

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Percy Camilo
Just popping in
Just popping in
Posts: 9
Joined: Fri Jul 28, 2006 22:00
Location: Perú

cube and sphere mapping OpenGL

Postby Percy Camilo » Tue Aug 08, 2006 08:04

Hello i have a problem , wen enable a cube or sphere mapping (in the render function of my GL class) all the gui stuff dissapear buttons, frames, scrools, etc... why is that ?

this code is the problem: for example i enable the sphere mapping with :
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
is happend too with
glEnable(GL_TEXTURE_CUBE_MAP);

Code: Select all

...
  glLoadIdentity();
  glRotatef(30.0, 1.0, 0.0, 0.0);

  glEnable(GL_CULL_FACE);
  glEnable(GL_TEXTURE_2D);
  glBindTexture(GL_TEXTURE_2D, pctatex.mTexture2D[0]);
    glEnable(GL_TEXTURE_GEN_S);
    glEnable(GL_TEXTURE_GEN_T);
    glEnable(GL_TEXTURE_GEN_R);
  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);

  pctaVector uN;
...


please i need help.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Aug 08, 2006 08:12

I could imagine that disabling these states before calling renderGUI would solve the problem.
The OpenGL renderer does not take the entire OpenGL state machine into account. Not all states are initialised. IIRC cube map texturing has higher priority than 2d texturing, thus it will override any texturing CEGUI tries to do.
You could let us know what glDisable calls you have to do before renderGUI, and we will add them to the OpenGL renderer.

Percy Camilo
Just popping in
Just popping in
Posts: 9
Joined: Fri Jul 28, 2006 22:00
Location: Perú

Postby Percy Camilo » Tue Aug 08, 2006 08:33

SOLVED
Yes you're right , thx a lot
:wink:
i disable all the textures target , i do this add glDisable in the end of my render func:


Code: Select all

void CSomeGLClass::render()
{
   .......
  glRotatef(30.0, 1.0, 0.0, 0.0);

  glEnable(GL_CULL_FACE);
  glEnable(GL_TEXTURE_2D);
  glBindTexture(GL_TEXTURE_2D, pctatex.mTexture2D[0]);
    glEnable(GL_TEXTURE_GEN_S);
    glEnable(GL_TEXTURE_GEN_T);
    glEnable(GL_TEXTURE_GEN_R);
  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);

  pctaVector uN;
  ..................
  ..................
  ..................
  .................. 

// this solved the problem
  glDisable(GL_CULL_FACE);
  glDisable(GL_TEXTURE_2D);
  glDisable(GL_TEXTURE_GEN_S);
  glDisable(GL_TEXTURE_GEN_T);
  glDisable(GL_TEXTURE_GEN_R);
}


thx again
bytes


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests