Ignore:
Timestamp:
09/01/08 18:33:14 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2891 r2892  
    9494static int winWidth = 1024; 
    9595static int winHeight = 768; 
     96 
     97//static int winWidth = 512; 
     98//static int winHeight = 512; 
     99 
     100 
    96101static float winAspectRatio = 1.0f; 
    97102 
     
    107112static int texHeight = 768; 
    108113 
    109 //static int texWidth = 512; 
    110 //static int texHeight = 384; 
    111  
    112 //static int texWidth = 2048; 
    113 //static int texHeight = 2048; 
    114114 
    115115int renderedObjects = 0; 
     
    175175 
    176176static Matrix4x4 matProjectionView = IdentityMatrix(); 
     177static Matrix4x4 matViewing = IdentityMatrix(); 
    177178 
    178179ShadowMapping *shadowMapping = NULL; 
     
    434435        ShadowMapping::Init(sCgContext); 
    435436 
    436         //deferredShader = new DeferredShader(texWidth, texHeight); 
    437         //ssaoShader = new SsaoShader(texWidth, texHeight, camera, myfar / 10.0f); 
    438  
    439437 
    440438        // initialize the render traverser 
     
    448446 
    449447        shadowMapping = new ShadowMapping(bvh->GetBox(), 512); 
    450         shadowMapping->ComputeShadowMap(light, traverser); 
    451  
     448         
    452449        // frame time is restarted every frame 
    453450        frameTimer.Start(); 
     
    795792        camera->SetupCameraView(); 
    796793 
    797         // set lights 
    798         GLfloat position[] = {0.8f, -1.0f, 0.7f, 0.0f}; 
    799         glLightfv(GL_LIGHT0, GL_POSITION, position); 
    800  
    801         GLfloat position1[] = {-0.5f, 0.5f, 0.4f, 0.0f}; 
    802         glLightfv(GL_LIGHT1, GL_POSITION, position1); 
    803  
    804          
     794                 
    805795        ///////////////// 
    806796 
    807         Matrix4x4 matViewing, matProjection; 
     797        Matrix4x4 matProjection; 
    808798 
    809799        camera->GetModelViewMatrix(matViewing); 
     
    876866        } 
    877867         
    878          
    879         //shadowMapping->ComputeShadowMap(light, traverser); 
    880  
    881  
    882  
    883868        // render without shading 
    884869        switch (renderType) 
     
    918903        case RenderState::DEFERRED: 
    919904 
     905                shadowMapping->ComputeShadowMap(light, traverser); 
     906 
    920907                if (!fbo) InitFBO(); 
    921908 
     
    958945        SetupEyeView(); 
    959946 
    960         // actually render the scene geometry using one of the specified algorithms 
     947        // set up lights 
     948        GLfloat position[] = {0.8f, -1.0f, 0.7f, 0.0f}; 
     949        glLightfv(GL_LIGHT0, GL_POSITION, position); 
     950 
     951        GLfloat position1[] = {-0.5f, 0.5f, 0.4f, 0.0f}; 
     952        glLightfv(GL_LIGHT1, GL_POSITION, position1); 
     953 
     954        // actually render the scene geometry using the specified algorithm 
    961955        traverser->RenderScene(); 
    962  
    963956 
    964957 
     
    999992                { 
    1000993                        if (!ssaoShader) ssaoShader = new SsaoShader(texWidth, texHeight, camera, myfar / 10.0f); 
    1001                         //DEL_PTR(deferredShader); 
    1002994                        ssaoShader->Render(fbo, oldViewProjMatrix, ssaoExpFactor); 
    1003995 
     
    1006998                { 
    1007999                        if (!deferredShader) deferredShader = new DeferredShader(texWidth, texHeight); 
    1008                         //DEL_PTR(ssaoShader); 
    1009                         deferredShader->Render(fbo); 
     1000                         
     1001                        //deferredShader->Render(fbo); 
     1002                        deferredShader->Render(fbo, matViewing, shadowMapping); 
    10101003                } 
    10111004        } 
    1012         else 
    1013         { 
    1014                 /*DEL_PTR(fbo); 
    1015                 DEL_PTR(ssaoShader); 
    1016                 DEL_PTR(deferredShader); 
    1017                 */ 
    1018         } 
     1005         
    10191006         
    10201007        /////////// 
     
    14981485        const float offs = box.Size().x * 0.3f; 
    14991486         
    1500         //Vector3 vizpos = Vector3(box.Min().x, box.Min().y + box.Size().y * 0.5f, box.Min().z + box.Size().z * 50); 
    15011487        Vector3 vizpos = Vector3(box.Min().x, box.Min().y  - box.Size().y * 0.35f, box.Min().z + box.Size().z * 50); 
    15021488         
    15031489        visCamera->SetPosition(vizpos); 
    15041490        visCamera->ResetPitchAndYaw(); 
    1505         //visCamera->Pitch(M_PI); 
    1506  
     1491         
    15071492        glPushAttrib(GL_VIEWPORT_BIT); 
    15081493        glViewport(winWidth - winWidth / 3, winHeight - winHeight / 3, winWidth / 3, winHeight / 3); 
Note: See TracChangeset for help on using the changeset viewer.