Changeset 3151 for GTP/trunk/App/Demos
- Timestamp:
- 11/20/08 18:40:28 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3150 r3151 291 291 //-- the flip-flop fbos 292 292 293 const int dsw = w / 2; const int dsh = h / 2;294 //const int dsw = w; const int dsh = h;293 //const int dsw = w / 2; const int dsh = h / 2; 294 const int dsw = w; const int dsh = h; 295 295 296 296 mIllumFbo = new FrameBufferObject(dsw, dsh, FrameBufferObject::DEPTH_NONE); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3146 r3151 477 477 //LoadModel("hbuddha.dem", dynamicObjects); 478 478 //LoadModel("venusm.dem", dynamicObjects); 479 //LoadModel("objects.dem", dynamicObjects);479 LoadModel("camel.dem", dynamicObjects); 480 480 //LoadModel("toyplane2.dem", dynamicObjects); 481 LoadModel("elephal.dem", dynamicObjects);481 //LoadModel("elephal.dem", dynamicObjects); 482 482 483 483 resourceManager->mUseNormalMapping = false; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3143 r3151 11 11 // for quadratic falloff 12 12 //#define SAMPLE_INTENSITY 0.2f 13 #define SAMPLE_INTENSITY 0.07f 14 //#define SAMPLE_INTENSITY 0.015f 13 //#define SAMPLE_INTENSITY 0.07f 14 15 #define SAMPLE_INTENSITY 0.075f 15 16 16 17 #define SAMPLE_RADIUS 8e-1f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3150 r3151 245 245 246 246 /** The ssao shader returning the an intensity value between 0 and 1 247 This version of the ssao shader uses the dotproduct between pixel and 248 sample normal as weight. 247 249 */ 248 250 float2 ssao2(fragment IN, … … 287 289 //if ((texcoord.x <= 1.0f) && (texcoord.x >= 0.0f) && (texcoord.y <= 1.0f) && (texcoord.y >= 0.0f)) ++ numSamples; 288 290 const float3 samplePos = ReconstructSamplePos(colors, texcoord, bl, br, tl, tr); 289 const float3 sampleNormal = normalize(tex2Dlod(normalTex, float4( IN.texCoord * 4.0f, 0, 0)).xyz);291 const float3 sampleNormal = normalize(tex2Dlod(normalTex, float4(texcoord, 0, 0)).xyz); 290 292 291 293 … … 299 301 300 302 // angle between current normal and direction to sample controls AO intensity. 301 float cosAngle = max(dot(sampleNormal, normal), .0f); 303 //const float cosAngle = max(-dot(sampleNormal, normal), .0f); 304 //const float cosAngle = .5f - dot(sampleNormal, normal) * 0.5f; 305 float cosAngle = .5f + dot(sampleNormal, -normal) * 0.5f; 306 307 float dirAngle = dot(dirSample, normal); 308 309 cosAngle *= step(0.0f, dirAngle); 310 311 //cosAngle *= step(0.5f, cosAngle); 312 //const float cosAngle = .5f * dot(sampleNormal, normal) + 1.0f; 302 313 303 314 // the distance_scale offset is used to avoid singularity that occurs at global illumination when … … 321 332 322 333 323 /** The ssao shader returning the an intensity value between 0 and 1 334 /** The ssao shader returning the an intensity value between 0 and 1. 335 This version of the ssao shader uses the dotproduct between 336 pixel-to-sample direction and sample normal as weight. 324 337 */ 325 338 float2 ssao(fragment IN, … … 374 387 375 388 // angle between current normal and direction to sample controls AO intensity. 376 float cosAngle = max(dot(dirSample, normal), .0f);389 const float cosAngle = max(dot(dirSample, normal), .0f); 377 390 378 391 // the distance_scale offset is used to avoid singularity that occurs at global illumination when … … 465 478 if (eyeSpaceDepth < 1e10f) 466 479 { 467 ao = ssao(IN, colors, noiseTex, samples, normal,468 eyeSpacePos.xyz, scaleFactor, bl, br, tl, tr, normalize(viewDir));480 //ao = ssao(IN, colors, noiseTex, samples, normal, eyeSpacePos.xyz, scaleFactor, bl, br, tl, tr, normalize(viewDir)); 481 ao = ssao2(IN, colors, noiseTex, samples, normal, eyeSpacePos.xyz, scaleFactor, bl, br, tl, tr, normalize(viewDir), normals); 469 482 } 470 483 else
Note: See TracChangeset
for help on using the changeset viewer.