Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9073 in orxonox.OLD for branches


Ignore:
Timestamp:
Jul 3, 2006, 11:39:27 PM (18 years ago)
Author:
ponder
Message:

The culling state is now reset after renering the terrain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/graphics/importer/terrain/terrain.cc

    r9071 r9073  
    238238        }       
    239239}
     240
    240241void Terrain::draw( )
    241242{
     
    247248        //Due to some reason, the OpenGL implementors chose the plane equation
    248249        //to an array of doubles. So we will make them happy.
    249         //double farPlane[] = { far.n.x, far.n.y, far.n.z, far.d };
    250         //glEnable( GL_CLIP_PLANE0 );
    251         //glClipPlane( GL_CLIP_PLANE0, farPlane );
     250        double farPlane[] = { far.n.x, far.n.y, far.n.z, far.d };
     251        glEnable( GL_CLIP_PLANE0 );
     252        glClipPlane( GL_CLIP_PLANE0, farPlane );
    252253        glPushAttrib( GL_ALL_ATTRIB_BITS );
    253254        glPushClientAttrib( GL_CLIENT_VERTEX_ARRAY_BIT );
     
    266267                glDisableClientState( GL_NORMAL_ARRAY );
    267268        glDisable( GL_CULL_FACE );
    268         glCullFace( GL_BACK );
    269269        glDisable( GL_LIGHTING );
    270270        glColor3f( 1.0f, 1.0f, 1.0f );
     
    291291                        glDisable( GL_TEXTURE_2D );
    292292                }
    293 
     293                glEnable( GL_CULL_FACE );
     294                glCullFace( GL_BACK );
    294295                glClientActiveTextureARB( GL_TEXTURE0_ARB );
    295296                glActiveTextureARB( GL_TEXTURE0_ARB );
     
    305306                glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );                         
    306307                glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
    307                 glEnable( GL_CULL_FACE );
     308               
    308309                for ( unsigned j = 0; j < buffers.size(); ++j ) {
    309310                        BufferInfo bi = buffers[j];
     
    336337        glPopAttrib();
    337338        glPopClientAttrib();
     339        glCullFace( GL_FRONT );
    338340        glDisable( GL_CLIP_PLANE0 );
    339341}
Note: See TracChangeset for help on using the changeset viewer.