Ignore:
Timestamp:
09/02/08 09:07:45 (16 years ago)
Author:
mattausch
Message:

shadow mapping almost working (but ulgy!!)

File:
1 edited

Legend:

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

    r2893 r2894  
    175175 
    176176static Matrix4x4 matProjectionView = IdentityMatrix(); 
    177 static Matrix4x4 matViewing = IdentityMatrix(); 
    178  
    179 ShadowMapping *shadowMapping = NULL; 
     177 
     178 
     179ShadowMap *shadowMap = NULL; 
    180180Light *light = NULL; 
    181181 
     
    433433        DeferredShader::Init(sCgContext); 
    434434        SsaoShader::Init(sCgContext); 
    435         ShadowMapping::Init(sCgContext); 
    436435 
    437436 
     
    446445        light = new Light(lightDir, RgbaColor(1, 1, 1, 1)); 
    447446 
    448         shadowMapping = new ShadowMapping(bvh->GetBox(), 4096); 
     447        const float shadowSize = 4096; 
     448        shadowMap = new ShadowMap(shadowSize, bvh->GetBox(), camera); 
    449449         
    450450        // frame time is restarted every frame 
     
    796796        ///////////////// 
    797797 
    798         Matrix4x4 matProjection; 
     798        Matrix4x4 matViewing, matProjection; 
    799799 
    800800        camera->GetModelViewMatrix(matViewing); 
     
    904904        case RenderState::DEFERRED: 
    905905 
    906                 shadowMapping->ComputeShadowMap(light, traverser); 
     906                shadowMap->ComputeShadowMap(light, traverser); 
    907907 
    908908                if (!fbo) InitFBO(); 
     
    975975        //-- render sky 
    976976 
    977         // q: should we render sky after deferred shading? (would conveniently solves some issues) 
    978         // (e.g, skys without shadows) 
     977        // q: should we render sky after deferred shading?  
     978        // this would conveniently solves some issues (e.g, skys without shadows) 
    979979 
    980980        RenderSky(); 
     
    999999                        if (!deferredShader) deferredShader = new DeferredShader(texWidth, texHeight, myfar / 10.0f); 
    10001000                         
    1001                         //deferredShader->Render(fbo); 
    1002                         deferredShader->Render(fbo, matViewing, shadowMapping); 
     1001                        deferredShader->Render(fbo, shadowMap); 
    10031002                } 
    10041003        } 
Note: See TracChangeset for help on using the changeset viewer.