Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8648 in orxonox.OLD


Ignore:
Timestamp:
Jun 20, 2006, 8:44:18 PM (18 years ago)
Author:
ponder
Message:

Disabled depth test for the skybox. Its not necessary. And this way we make sure, that the sky is always
behind everything

Location:
branches/terrain/src
Files:
5 edited

Legend:

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

    r8642 r8648  
    5151                                x > 0                   ? getPage( x-1, z+0 ) : NULL,
    5252                                x < pagesX-1    ? getPage( x+1, z+0 ) : NULL,
    53                                 z > 0                   ? getPage( x+0, z-1 ) : NULL,
    54                                 z < pagesZ-1    ? getPage( x+0, z+1 ) : NULL );
     53                                z < pagesZ-1    ? getPage( x+0, z+1 ) : NULL,
     54                                z > 0                   ? getPage( x+0, z-1 ) : NULL );
    5555       
    5656        printf( "looks good\n" );
     
    6969                node->setChildren( NULL, NULL, NULL, NULL );
    7070        }
    71         else {
    72                 assert( ( _x0 % 2 ) == 0 );
    73                 assert( ( _x1 % 2 ) == 0 );
    74                 assert( ( _z0 % 2 ) == 0 );
    75                 assert( ( _z1 % 2 ) == 0 );             
     71        else { 
    7672                node = new TerrainQuad( this, _x0, _z0, _x1, _z1 );
    7773                node->setChildren(
     
    200196        broker->acquire( bi.vbIdentifier, bi.ibIdentifier );
    201197        buffers.push_back( bi );
     198        int dirtyRounds = 0;
    202199        do {
     200                dirtyRounds++;
    203201                dirty = false;
    204202                page = activePages;
     
    211209                        }
    212210                        wantedLeft = wantedRight = wantedBottom = wantedTop = page->getWantedLOD();
    213                         if ( ( neighbor = page->getLeft() ) )
     211                        if ( ( neighbor = page->getLeft() ) && ( neighbor->isActive() ) )
    214212                                wantedLeft = neighbor->getWantedLOD();
    215                         if ( ( neighbor = page->getRight() ) )
     213                        if ( ( neighbor = page->getRight() ) && ( neighbor->isActive() ) )
    216214                                wantedRight = neighbor->getWantedLOD();
    217                         if ( ( neighbor = page->getTop() ) )
     215                        if ( ( neighbor = page->getTop() ) && ( neighbor->isActive() ) )
    218216                                wantedTop = neighbor->getWantedLOD();
    219                         if ( ( neighbor = page->getBottom() ) )
     217                        if ( ( neighbor = page->getBottom() ) && ( neighbor->isActive() ) )
    220218                                wantedBottom = neighbor->getWantedLOD();                       
    221219               
     
    224222                        if ( minLOD < page->getWantedLOD()-1 ) {
    225223                                page->setWantedLOD( minLOD+1 );
    226                                 //dirty = true;
     224                                dirty = true;
    227225                        }       
    228226                        page = page->getNext();
    229227                }
    230228        } while ( dirty );
     229        printf( "dirtyrounds: %d\n", dirtyRounds );
    231230        page = activePages;
    232231       
     
    247246                        indices, GL_DYNAMIC_DRAW_ARB );
    248247        }
    249         s = 500.0f;
     248        s = 200.0f;
     249        glPushAttrib( GL_COLOR_BUFFER_BIT );
    250250        for ( unsigned int i = 0; i < materials.size(); ++i ) {
    251251                page = activePages;     
     
    308308        glDisableClientState( GL_TEXTURE_COORD_ARRAY );
    309309        glEnable( GL_LIGHTING );
     310        glMatrixMode( GL_TEXTURE );
     311        glLoadIdentity();
     312        glPopAttrib();
    310313}
    311314
  • branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc

    r8641 r8648  
    9898                _adapt[TP_RIGHT] = ( wantedLOD - right->getWantedLOD() ) > 0;
    9999               
    100         if ( top && top->isVisible)
     100        if ( top && top->isVisible )
    101101                _adapt[TP_TOP] = ( wantedLOD - top->getWantedLOD() ) > 0;                               
    102102               
     
    128128                wantedLOD = TerrainPage::MAX_LODS-1;
    129129        }       
    130         // Calculate the tween factor. The calculation is different if LOD is 0
    131         //
    132         if ( wantedLOD > 0 ) {
    133                
    134         }
    135         else {
    136                
    137         }
    138130        return wantedLOD;
    139131}
     
    244236{
    245237       
    246         bool    leftChanged     = ( left && left->isVisible ) && ( left->wantedLOD != left->currentLOD ),
    247                         rightChanged    = ( right && right->isVisible ) && ( right->wantedLOD != right->currentLOD ),
    248                         topChanged              = ( top && top->isVisible ) && ( top->wantedLOD != currentLOD ),
    249                         bottomChanged   = ( bottom && bottom->isVisible ) && ( bottom->wantedLOD != bottom->currentLOD ),
     238        bool    leftChanged     = ( left && left->isActive() ) &&
     239                                ( left->wantedLOD != left->currentLOD ),
     240                        rightChanged    = ( right && right->isActive() ) &&
     241                                ( right->wantedLOD != right->currentLOD ),
     242                        topChanged              = ( top && top->isActive() ) &&
     243                                ( top->wantedLOD != currentLOD ),
     244                        bottomChanged   = ( bottom && bottom->isActive() ) &&
     245                                ( bottom->wantedLOD != bottom->currentLOD ),
    250246                        iChanged                =  wantedLOD != currentLOD;
    251247                               
     
    518514        int zStart = 0, zEnd = owner->getPageSize()-stride;
    519515       
    520         if ( adapt[TP_TOP] ) {
     516        if ( adapt[TP_BOTTOM] ) {
    521517                tesselateRow( 0, stride / 2, stride, adapt[TP_LEFT], adapt[TP_RIGHT] );
    522518                zStart+= stride;
    523519        }
    524520       
    525         if ( adapt[TP_BOTTOM] )
     521        if ( adapt[TP_TOP] )
    526522                zEnd-= stride;
    527523               
     
    530526       
    531527
    532         if ( adapt[TP_BOTTOM] ) {
    533                
    534         addAgain( );
    535         addIndex( getIndex( 0, owner->getPageSize()-1-stride ) );
    536        
    537         tesselateRow( owner->getPageSize()-1-stride, stride / 2, stride, adapt[TP_LEFT], adapt[TP_RIGHT] );
     528        if ( adapt[TP_TOP] ) {
     529                addAgain( );
     530                addIndex( getIndex( 0, owner->getPageSize()-1-stride ) );
     531                tesselateRow( owner->getPageSize()-1-stride, stride / 2,
     532                        stride, adapt[TP_LEFT], adapt[TP_RIGHT] );
    538533        }
    539534       
  • branches/terrain/src/lib/graphics/importer/terrain/terrain_page.h

    r8641 r8648  
    210210                        return true;
    211211                }
    212                
    213212                inline void setWantedLOD( int _lod )
    214213                {
  • branches/terrain/src/world_entities/camera.cc

    r8548 r8648  
    3636  this->setFovy(60.0);
    3737  this->setAspectRatio(1.2f);
    38   this->setClipRegion( .1, 80.0f );
     38  this->setClipRegion( .1, 40.0f );
    3939
    4040  this->setViewMode(Camera::ViewNormal);
     
    8383{
    8484  this->nearClip = nearClip;
    85   this->farClip = farClip;
     85  this->farClip = 400.0f;//farClip;
    8686}
    8787
  • branches/terrain/src/world_entities/skybox.cc

    r8037 r8648  
    230230//   glPushAttrib(GL_LIGHTING_BIT);
    231231  glDisable(GL_LIGHTING);
    232 
     232  glDisable( GL_DEPTH_TEST );   
    233233  glDisable(GL_FOG);
    234234
Note: See TracChangeset for help on using the changeset viewer.