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 2 of 2

Thread: Problem with clip planes on ATI

Threaded View

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

    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
        glCullFace(GL_FRONT);
     
        // Set our plane equation and turn clipping on
        CDouble plane[4] = {0.0, 1.0, 0.0, -m_fWaterCPos[1]};
        //glEnable(GL_CLIP_PLANE0);
        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.
    <span style="color: #006600">-Ehsan-</span>

Posting Permissions

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