Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Skybox visual glitch

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2012
    Location
    Angus
    Posts
    5

    Skybox visual glitch

    Hi, I'm trying to create a skybox with a cube and depth testing. I'm getting a visual glitch that you can see in this picture

    as you can see not all the skybox is drawn, just the part you're looking at directly, a section is cut off (this undrawn section moves when you turn)

    this is my code:

    glPushMatrix();
    glDisable(GL_DEPTH_TEST);
    glTranslatef(cam.fOrigin.x, cam.fOrigin.y, cam.fOrigin.z);
    Draw_CUBE();
    glPopMatrix();
    glEnable(GL_DEPTH_TEST);


    any ideas?

  2. #2
    Junior Member Regular Contributor Kopelrativ's Avatar
    Join Date
    Apr 2011
    Posts
    214

    Re: Skybox visual glitch

    I had a similar problem, maybe this can help you: http://www.opengl.org/discussion_boa...;Number=309296

  3. #3
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: Skybox visual glitch

    looks like it's being clipped by the near plane.
    What's in DRAW_CUBE and what depth state have you set inc. Perspective matrix?

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2012
    Location
    Angus
    Posts
    5

    Re: Skybox visual glitch

    Quote Originally Posted by BionicBytes
    looks like it's being clipped by the near plane.
    What's in DRAW_CUBE and what depth state have you set inc. Perspective matrix?
    yeah I figured it out, the cube that I had drawn around the camera was too small and that was causing it to get clipped, I scaled it by 1.2 and it fixed the problem, thanks for the replys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •