Changeset 3175 for GTP/trunk/App/Demos
- Timestamp:
- 11/26/08 20:45:11 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3169 r3175 53 53 useFullScreen=0 54 54 55 # the used render method (forward, forward + depth pass, deferred, deferred + depth pass 56 renderMethod=2 55 57 56 58 #modelPath=data/city/model/ … … 58 60 59 61 ############ 60 # shader options 62 # shader options for deferred rendering 61 63 62 64 # ssao temporal coherence factor … … 64 66 # tone mapping 65 67 useHDR=0 68 # use antialiasing 69 useAA=1 70 # use ssao / color bleeding 71 useAdvancedShading=1 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3168 r3175 498 498 DirectionalLight *light, 499 499 bool useToneMapping, 500 bool useAntiAliasing, 500 501 ShadowMap *shadowMap 501 502 ) … … 511 512 { 512 513 // downsample fbo buffers 513 // colors514 //DownSample(fbo, colorBufferIdx, mDownSampleFbo, 0, sCgScaleDepthProgram);515 514 PrepareSsao(fbo); 516 //DownSample(fbo, 1, mDownSampleFbo, 1, sCgDownSampleProgram); // normals517 //DownSample(fbo, 2, mDownSampleFbo, 2, sCgDownSampleProgram); // offsets518 515 } 519 516 … … 544 541 } 545 542 546 // as multisampling is difficult / costly with deferred shading, 547 // at least do some antialiasing 548 //AntiAliasing(fbo, light); 549 550 // just output the latest buffer 551 Output(fbo); 543 // multisampling is difficult / costly with deferred shading 544 // at least do some edge blurring 545 546 if (useAntiAliasing) 547 AntiAliasing(fbo, light); 548 else 549 Output(fbo); // just output the latest buffer 552 550 553 551 glEnable(GL_LIGHTING); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h
r3167 r3175 41 41 DirectionalLight *light, 42 42 bool useToneMapping, 43 bool useAntiAliasing, 43 44 ShadowMap *shadowMap = NULL 44 45 ); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3167 r3175 207 207 bool renderLightView = false; 208 208 bool useHDR = true; 209 bool useAntiAliasing = true; 209 210 210 211 PerfTimer frameTimer, algTimer; … … 233 234 234 235 235 236 236 //DeferredRenderer::SAMPLING_METHOD samplingMethod = DeferredRenderer::SAMPLING_POISSON; 237 237 DeferredRenderer::SAMPLING_METHOD samplingMethod = DeferredRenderer::SAMPLING_QUADRATIC; … … 241 241 DeferredRenderer *deferredShader = NULL; 242 242 243 //SceneEntity *cube = NULL; 243 244 244 SceneEntity *buddha = NULL; 245 245 SceneEntity *skyDome = NULL; … … 378 378 env.GetBoolParam(string("useLODs"), useLODs); 379 379 env.GetBoolParam(string("useHDR"), useHDR); 380 380 env.GetBoolParam(string("useAA"), useAntiAliasing); 381 env.GetBoolParam(string("useAdvancedShading"), useAdvancedShading); 382 383 env.GetIntParam(string("renderMethod"), renderMethod); 381 384 382 385 //env.GetStringParam(string("modelPath"), model_path); … … 396 399 cout << "temporal coherence: " << ssaoTempCohFactor << endl; 397 400 cout << "shadow size: " << shadowSize << endl; 401 cout << "render method: " << renderMethod << endl; 402 cout << "use antialiasing: " << useAntiAliasing << endl; 403 cout << "use advanced shading: " << useAdvancedShading << endl; 398 404 399 405 //cout << "model path: " << model_path << endl; … … 794 800 795 801 796 const bool use ToneMapping=802 const bool useHDRValues = 797 803 ((renderMethod == RENDER_DEPTH_PASS_DEFERRED) || 798 804 (renderMethod == RENDER_DEFERRED)) && useHDR; … … 802 808 Vector3 sunDiffuse; 803 809 804 preetham->ComputeSunColor(lightDir, sunAmbient, sunDiffuse, !use ToneMapping);810 preetham->ComputeSunColor(lightDir, sunAmbient, sunDiffuse, !useHDRValues); 805 811 806 812 ambient[0] = sunAmbient.x; … … 895 901 896 902 897 // draw to 3 color buffers 898 // a color, normal, and positions buffer 903 // draw to 3 render targets 899 904 if (sCurrentMrtSet == 0) 900 905 { … … 1024 1029 renderState.SetRenderTechnique(DEPTH_PASS); 1025 1030 1026 if (!fbo) InitFBO(); fbo->Bind(); 1031 if (!fbo) InitFBO(); 1032 fbo->Bind(); 1027 1033 1028 1034 glDrawBuffers(1, mrt); … … 1134 1140 1135 1141 ShadowMap *sm = showShadowMap ? shadowMap : NULL; 1136 deferredShader->Render(fbo, ssaoTempCohFactor, light, useHDR, sm);1142 deferredShader->Render(fbo, ssaoTempCohFactor, light, useHDR, useAntiAliasing, sm); 1137 1143 } 1138 1144 … … 1250 1256 //if (ssaoTempCohFactor > 1.0f) ssaoExpFactor = 1.0f; 1251 1257 break; 1252 case '9': 1258 case 'l': 1259 case 'L': 1253 1260 useLODs = !useLODs; 1254 1261 SceneEntity::SetUseLODs(useLODs); … … 1311 1318 traverser->SetUseTightBounds(useTightBounds); 1312 1319 break; 1313 case ' l':1314 case ' L':1320 case 'v': 1321 case 'V': 1315 1322 renderLightView = !renderLightView; 1316 1323 break; … … 1318 1325 case 'H': 1319 1326 useHDR = !useHDR; 1327 break; 1328 case 'i': 1329 case 'I': 1330 useAntiAliasing = !useAntiAliasing; 1320 1331 break; 1321 1332 default: … … 1991 2002 RenderShadowMap(maxVisibleDist); 1992 2003 } 1993 1994 //glViewport(0, 0, texWidth, texHeight);1995 2004 // initialize deferred rendering 1996 2005 InitDeferredRendering(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg
r3168 r3175 63 63 float4 dd; // the gradients 64 64 65 for (int i = 0; i < 4; ++ i)66 {67 dd[i] = depthVals[i * 2] + depthVals[i * 2 + 1];68 }65 dd[0] = depthVals[0] + depthVals[1]; 66 dd[1] = depthVals[2] + depthVals[3]; 67 dd[2] = depthVals[4] + depthVals[5]; 68 dd[3] = depthVals[6] + depthVals[7]; 69 69 70 //for (int i = 0; i < 4; ++ i) 71 // dd[i] = depthVals[i * 2] + depthVals[i * 2 + 1]; 72 70 73 //dd = abs(2.0f * (1.0f - abs(1.0f - centerDepth / dd))) - barrier.y; 71 74 dd = abs(2.0f * centerDepth - dd) - barrier.y; … … 90 93 91 94 92 float4 col = (s0 + s1 + s2 + s3 + centerColor) * 0.2f;93 //float4 col = (s0 + s1 + s2 + s3) * 0.25f;95 //float4 col = (s0 + s1 + s2 + s3 + centerColor) * 0.2f; 96 float4 col = (s0 + s1 + s2 + s3) * 0.25f; 94 97 //float4 col = float4(ne.x, ne.x, ne.x, 0); 95 98 //float4 col = float4(de.x, de.x, de.x, 0); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3172 r3175 281 281 const float2 offset = samples[i]; 282 282 283 #if 0283 #if 1 284 284 //////////////////// 285 285 //-- add random noise: reflect around random normal vector (rather slow!)
Note: See TracChangeset
for help on using the changeset viewer.