Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Problem with clip planes on ATI

  1. #1
    Advanced Member Frequent Contributor Ehsan Kamrani's Avatar
    Join Date
    May 2005

    Problem with clip planes on ATI

    I have a problem with clipping on my ATI card. but my NVidia graphics card clips the geometries with the same code. Note that I have updated the latest driver of my ATI graphics card from HP website ( it's a laptop). Here are the information of my ATI graphics card:
    OpenGL Renderer: Radeon HD 6490M
    OpenGL Version: 4.1.10664 compatibility profile context
    GLSL version: 4.10

    in my source code I specify the clip plane:
    Code :
        // Translate the world, then flip it upside down
        glTranslatef(0.0f, m_fWaterCPos[1]*2.0f, 0.0f);
        glScalef(1.0, -1.0, 1.0);
        // Since the world is updside down we need to change the culling to FRONT
        // Set our plane equation and turn clipping on
        CDouble plane[4] = {0.0, 1.0, 0.0, -m_fWaterCPos[1]};
        glClipPlane(GL_CLIP_PLANE0, plane);
        glUniform4fv(glGetUniformLocation( g_shaderType , "plane_equation"), 1, (GLfloat*)plane );
        glEnable( GL_CLIP_DISTANCE0 );
        //Render the scene
        glDisable( GL_CLIP_DISTANCE0 );
    Then in my vertex shader:
    Code :
    gl_ClipDistance[0]= dot( gl_ModelViewMatrix * gl_Vertex, gl_ModelViewMatrix * plane_equation.xyzw);

    Does my code have problem?
    Last edited by Ehsan Kamrani; 05-10-2012 at 12:48 AM.

  2. #2
    Advanced Member Frequent Contributor Ehsan Kamrani's Avatar
    Join Date
    May 2005
    My problem solved. I was sending the uniform information before using the shader But it seems that NVidia manages the clipping internally. It means that it reads the fixed functions such as glClipPlane() and ignores the clipping in shader( I disabled the gl_ClipDistance in my shader and my NVidia card clipped the scene correctly).

Posting Permissions

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