- Timestamp:
- 09/24/08 11:08:13 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r2967 r2968 97 97 static CGparameter sLightDirParam; 98 98 static CGparameter sLightDirShadowParam; 99 100 99 static CGparameter sImageKeyParam; 100 static CGparameter sWhiteLumParam; 101 101 102 102 //#define USE_3D_SSAO … … 285 285 sColorsTexDeferredParam = cgGetNamedParameter(sCgDeferredProgram, "colors"); 286 286 sNormalsTexDeferredParam = cgGetNamedParameter(sCgDeferredProgram, "normals"); 287 287 288 sLightDirParam = cgGetNamedParameter(sCgDeferredProgram, "lightDir"); 288 289 } … … 407 408 408 409 sImageKeyParam = cgGetNamedParameter(sCgAntiAliasingProgram, "imageKey"); 410 sWhiteLumParam = cgGetNamedParameter(sCgAntiAliasingProgram, "whiteLum"); 409 411 410 412 sColorsTexAntiAliasingParam = cgGetNamedParameter(sCgAntiAliasingProgram, "colors"); … … 438 440 sNoiseTexShadowParam = cgGetNamedParameter(sCgDeferredShadowProgram, "noiseTexture"); 439 441 sSamplesShadowParam = cgGetNamedParameter(sCgDeferredShadowProgram, "samples"); 442 440 443 sLightDirShadowParam = cgGetNamedParameter(sCgDeferredShadowProgram, "lightDir"); 441 444 … … 667 670 void DeferredRenderer::AntiAliasing(FrameBufferObject *fbo) 668 671 { 669 const float imageKey = ToneMapper().CalcImageKey(fbo->GetColorBuffer(colorBufferIdx)); 670 671 GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); 672 ColorBufferObject *colorBuffer = fbo->GetColorBuffer(colorBufferIdx); 673 674 // we assume that we have a floating point rgba texture 675 float *pixels = (float *)colorBuffer->ReadTexture(); 676 677 const int w = colorBuffer->GetHeight(); 678 const int h = colorBuffer->GetWidth(); 679 680 const float imageKey = ToneMapper().CalcImageKey(pixels, w, h); 681 const float whiteLum = 0.5f * ToneMapper().CalcMaxLuminance(pixels, w, h); 682 683 delete [] pixels; 684 685 GLuint colorsTex = colorBuffer->GetTexture(); 672 686 GLuint normalsTex = fbo->GetColorBuffer(2)->GetTexture(); 673 687 … … 684 698 685 699 cgGLSetParameter1f(sImageKeyParam, imageKey); 700 cgGLSetParameter1f(sWhiteLumParam, whiteLum); 701 686 702 687 703 glColor3f(1.0f, 1.0f, 1.0f);
Note: See TracChangeset
for help on using the changeset viewer.