Ignore:
Timestamp:
09/03/08 01:57:45 (16 years ago)
Author:
mattausch
Message:

improved shadow mapping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp

    r2892 r2897  
    137137 
    138138        orthoCam->SetNear(0.0f); 
     139        orthoCam->Yaw(.5 * M_PI); 
    139140        orthoCam->SetDirection(Vector3(0, 0, -1)); 
    140141 
     
    155156        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    156157 
    157         glFrontFace(GL_CCW); 
    158         glCullFace(GL_BACK); 
    159          
    160         glEnable(GL_CULL_FACE); 
     158        glDisable(GL_CULL_FACE); 
    161159 
    162160        glShadeModel(GL_FLAT); 
    163161        glEnable(GL_DEPTH_TEST); 
    164162 
     163        glMatrixMode(GL_MODELVIEW); 
     164        glPushMatrix(); 
     165        glLoadIdentity(); 
     166 
    165167        glMatrixMode(GL_PROJECTION); 
    166168        glPushMatrix(); 
     169        glLoadIdentity(); 
    167170 
    168171        glOrtho(+xlen, -xlen, ylen, -ylen, 0.0f, mSceneBox.Size().z);  
    169172 
    170173        glMatrixMode(GL_MODELVIEW); 
    171         glPushMatrix(); 
    172174 
    173175        orthoCam->SetupCameraView(); 
     
    175177        mDepth = new float[texHeight * texWidth]; 
    176178 
     179        Camera *oldCam = renderer->GetCamera(); 
     180        renderer->SetCamera(orthoCam); 
     181 
    177182        renderer->RenderScene(); 
    178          
     183 
     184        renderer->SetCamera(oldCam); 
     185         
     186 
     187        glEnable(GL_CULL_FACE); 
     188 
     189        glMatrixMode(GL_MODELVIEW); 
    179190        glPopMatrix(); 
     191         
    180192        glMatrixMode(GL_PROJECTION); 
    181          
    182193        glPopMatrix(); 
    183194 
Note: See TracChangeset for help on using the changeset viewer.