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

Legend:

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

    r2966 r2967  
    3535static CGprogram sCgCombinedIllumProgram = NULL; 
    3636 
     37 
    3738/////////////////////////////////////// 
    3839 
     
    9899 
    99100static CGparameter sImageKeyParam; 
    100 static CGparameter sImageKeyShadowParam; 
    101101 
    102102//#define USE_3D_SSAO 
     
    286286                sNormalsTexDeferredParam = cgGetNamedParameter(sCgDeferredProgram, "normals"); 
    287287                sLightDirParam = cgGetNamedParameter(sCgDeferredProgram, "lightDir"); 
    288  
    289                 sImageKeyParam = cgGetNamedParameter(sCgDeferredProgram, "imageKey"); 
    290288        } 
    291289        else 
     
    408406                cgGLLoadProgram(sCgAntiAliasingProgram); 
    409407 
     408                sImageKeyParam = cgGetNamedParameter(sCgAntiAliasingProgram, "imageKey"); 
     409 
    410410                sColorsTexAntiAliasingParam = cgGetNamedParameter(sCgAntiAliasingProgram, "colors");   
    411411                sNormalsTexAntiAliasingParam = cgGetNamedParameter(sCgAntiAliasingProgram, "normals"); 
     
    440440                sLightDirShadowParam = cgGetNamedParameter(sCgDeferredShadowProgram, "lightDir"); 
    441441 
    442                 sImageKeyShadowParam = cgGetNamedParameter(sCgDeferredShadowProgram, "imageKey"); 
    443442 
    444443                PoissonDiscSampleGenerator2 poisson(NUM_PCF_TABS, 1.0f); 
     
    668667void DeferredRenderer::AntiAliasing(FrameBufferObject *fbo) 
    669668{ 
     669        const float imageKey = ToneMapper().CalcImageKey(fbo->GetColorBuffer(colorBufferIdx)); 
     670 
    670671        GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); 
    671672        GLuint normalsTex = fbo->GetColorBuffer(2)->GetTexture(); 
     
    681682        cgGLSetTextureParameter(sNormalsTexAntiAliasingParam, normalsTex); 
    682683        cgGLEnableTextureParameter(sNormalsTexAntiAliasingParam); 
     684 
     685        cgGLSetParameter1f(sImageKeyParam, imageKey); 
    683686 
    684687        glColor3f(1.0f, 1.0f, 1.0f); 
     
    708711void DeferredRenderer::FirstPass(FrameBufferObject *fbo, DirectionalLight *light) 
    709712{ 
    710         const float imageKey = ToneMapper().CalcImageKey(fbo->GetColorBuffer(0)); 
    711  
    712713        GLuint colorsTex = fbo->GetColorBuffer(0)->GetTexture(); 
    713714        GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture(); 
     
    737738        cgGLSetParameter3f(sLightDirParam, lightDir.x, lightDir.y, lightDir.z); 
    738739 
    739         cgGLSetParameter1f(sImageKeyParam, imageKey); 
    740740 
    741741        glColor3f(1.0f, 1.0f, 1.0f); 
     
    978978                                                                           ShadowMap *shadowMap) 
    979979{ 
    980         const float imageKey = ToneMapper().CalcImageKey(fbo->GetColorBuffer(0)); 
    981  
    982980        GLuint colorsTex = fbo->GetColorBuffer(0)->GetTexture(); 
    983981 
     
    10241022        cgGLSetParameter3f(sLightDirShadowParam, lightDir.x, lightDir.y, lightDir.z); 
    10251023 
    1026         // the average log luminance for tone mapping 
    1027         cgGLSetParameter1f(sImageKeyShadowParam, imageKey); 
    10281024 
    10291025        glColor3f(1.0f, 1.0f, 1.0f); 
Note: See TracChangeset for help on using the changeset viewer.