- Timestamp:
- 11/20/08 13:09:15 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3144 r3148 57 57 static ShaderProgram *sCgToneProgram = NULL; 58 58 static ShaderProgram *sCgDownSampleProgram = NULL; 59 static ShaderProgram *sCgSmoothSsaoProgram = NULL;60 59 static ShaderProgram *sCgScaleDepthProgram = NULL; 61 60 … … 374 373 sCgScaleDepthProgram = sm->CreateFragmentProgram("deferred", "ScaleDepth", "ScaleDepth"); 375 374 sCgLogLumProgram = sm->CreateFragmentProgram("tonemap", "CalcAvgLogLum", "avgLogLum"); 376 sCgSmoothSsaoProgram = sm->CreateFragmentProgram("combineSsao", "smoothSsao", "smoothSsao");377 375 378 376 … … 441 439 //////////////// 442 440 443 string smoothSsaoParams[] = {"normalsTex", "ssaoTex", "filterOffs", "filterWeights"};444 sCgSmoothSsaoProgram->AddParameters(smoothSsaoParams, 0, 4);445 446 447 ///////////448 441 449 442 const float filterWidth = 100.0f; … … 526 519 case SSAO: 527 520 ComputeSsao(fbo, tempCohFactor); 528 //SmoothSsao(fbo);529 521 CombineSsao(fbo); 530 522 break; … … 810 802 GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); 811 803 GLuint normalsTex = fbo->GetColorBuffer(1)->GetTexture(); 812 //GLuint ssaoTex = mIllumFbo->GetColorBuffer(2 - mIllumFboIndex)->GetTexture();813 804 GLuint ssaoTex = mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetTexture(); 814 805 … … 816 807 817 808 int i = 0; 809 818 810 sCgCombineSsaoProgram->SetTexture(i ++, colorsTex); 819 811 sCgCombineSsaoProgram->SetTexture(i ++, normalsTex); … … 827 819 Vector3 tl = mCornersView[2]; 828 820 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);834 821 835 822 … … 1117 1104 1118 1105 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 texture1127 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 1147 1106 } // namespace
Note: See TracChangeset
for help on using the changeset viewer.