Ignore:
Timestamp:
11/20/08 13:09:15 (16 years ago)
Author:
mattausch
Message:

done a little cleanup

File:
1 edited

Legend:

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

    r3144 r3148  
    5757static ShaderProgram *sCgToneProgram = NULL; 
    5858static ShaderProgram *sCgDownSampleProgram = NULL; 
    59 static ShaderProgram *sCgSmoothSsaoProgram = NULL; 
    6059static ShaderProgram *sCgScaleDepthProgram = NULL; 
    6160 
     
    374373        sCgScaleDepthProgram = sm->CreateFragmentProgram("deferred", "ScaleDepth", "ScaleDepth"); 
    375374        sCgLogLumProgram = sm->CreateFragmentProgram("tonemap", "CalcAvgLogLum", "avgLogLum"); 
    376         sCgSmoothSsaoProgram = sm->CreateFragmentProgram("combineSsao", "smoothSsao", "smoothSsao"); 
    377375 
    378376 
     
    441439        //////////////// 
    442440 
    443         string smoothSsaoParams[] = {"normalsTex", "ssaoTex", "filterOffs", "filterWeights"}; 
    444         sCgSmoothSsaoProgram->AddParameters(smoothSsaoParams, 0, 4); 
    445          
    446          
    447         /////////// 
    448441 
    449442        const float filterWidth = 100.0f; 
     
    526519        case SSAO: 
    527520                ComputeSsao(fbo, tempCohFactor); 
    528                 //SmoothSsao(fbo); 
    529521                CombineSsao(fbo); 
    530522                break; 
     
    810802        GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); 
    811803        GLuint normalsTex = fbo->GetColorBuffer(1)->GetTexture(); 
    812         //GLuint ssaoTex = mIllumFbo->GetColorBuffer(2 - mIllumFboIndex)->GetTexture(); 
    813804        GLuint ssaoTex = mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetTexture(); 
    814805         
     
    816807 
    817808        int i = 0; 
     809 
    818810        sCgCombineSsaoProgram->SetTexture(i ++, colorsTex); 
    819811        sCgCombineSsaoProgram->SetTexture(i ++, normalsTex); 
     
    827819        Vector3 tl = mCornersView[2]; 
    828820        Vector3 tr = mCornersView[3]; 
    829  
    830         sCgCombineSsaoProgram->SetValue3f(i ++, bl.x, bl.y, bl.z); 
    831         sCgCombineSsaoProgram->SetValue3f(i ++, br.x, br.y, br.z); 
    832         sCgCombineSsaoProgram->SetValue3f(i ++, tl.x, tl.y, tl.z); 
    833         sCgCombineSsaoProgram->SetValue3f(i ++, tr.x, tr.y, tr.z); 
    834821 
    835822 
     
    11171104 
    11181105 
    1119 void DeferredRenderer::SmoothSsao(FrameBufferObject *fbo) 
    1120 { 
    1121         mIllumFbo->Bind(); 
    1122  
    1123         GLuint normalsTex = fbo->GetColorBuffer(1)->GetTexture(); 
    1124         GLuint ssaoTex = mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetTexture(); 
    1125  
    1126         // overwrite old ssao texture 
    1127         glDrawBuffers(1, mrt + 2 - mIllumFboIndex); 
    1128  
    1129         glPushAttrib(GL_VIEWPORT_BIT); 
    1130         glViewport(0, 0, mIllumFbo->GetWidth(), mIllumFbo->GetHeight()); 
    1131  
    1132         int i = 0; 
    1133         sCgSmoothSsaoProgram->SetTexture(i ++, normalsTex); 
    1134         sCgSmoothSsaoProgram->SetTexture(i ++, ssaoTex); 
    1135  
    1136         sCgSmoothSsaoProgram->SetArray2f(i ++, (float *)ssaoFilterOffsets, NUM_SSAO_FILTERSAMPLES); 
    1137         sCgSmoothSsaoProgram->SetArray1f(i ++, (float *)ssaoFilterWeights, NUM_SSAO_FILTERSAMPLES); 
    1138          
    1139         DrawQuad(sCgSmoothSsaoProgram); 
    1140  
    1141         glPopAttrib(); 
    1142  
    1143         PrintGLerror("combine ssao"); 
    1144 } 
    1145  
    1146  
    11471106} // namespace 
Note: See TracChangeset for help on using the changeset viewer.