Changeset 3364
- Timestamp:
- 04/29/09 14:05:01 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj
r3361 r3364 156 156 IgnoreAllDefaultLibraries="false" 157 157 IgnoreDefaultLibraryNames="LIBCMT" 158 GenerateDebugInformation=" true"158 GenerateDebugInformation="false" 159 159 SubSystem="1" 160 160 LargeAddressAware="2" -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r3359 r3364 234 234 for (int i = 0; i < numShapes; ++ i) 235 235 { 236 if (i && (i % 1000 == 0)) cout << "loaded " << i << " shapes" << endl; 237 236 238 Geometry *geom = LoadGeometry(str); 237 239 Material *mat = LoadMaterial(str); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
r3363 r3364 235 235 pixel OUT; 236 236 237 float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0));238 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0));237 float4 col = tex2Dlod(colorsTex, float4(IN.texCoord, .0f, .0f)); 238 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, .0f, .0f)); 239 239 240 240 const float depth = col.w; … … 252 252 { 253 253 // the filtered ssao value 254 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight); 254 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, 255 bl, br, tl, tr, 256 xyStep, convergence, maxConvergence, spatialWeight); 255 257 } 256 258 … … 274 276 //OUT.illum_col.xyz = float3(ao.z * 1e-3f); 275 277 //OUT.illum_col.xyz = float3(ao.y * 1e-3f); 278 OUT.illum_col.xyz = float3(ao.y); 276 279 //OUT.illum_col.xyz = ao.xyz; 277 280 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3362 r3364 39 39 float4 outColor; 40 40 41 #if 0 41 42 // hack: prevent to shade the sky 42 #if 043 43 if (color.w > DEPTH_THRESHOLD) 44 44 { … … 47 47 else 48 48 { 49 if (useAO > 0.5f)49 if (useAO > .5f) 50 50 outColor = (ambient * ao + diffuse) * color; 51 51 else … … 250 250 251 251 // compute position from old frame for dynamic objects + translational portion 252 const float3 translatedPos = difVec - oldEyePos + worldPos.xyz;252 const float3 translatedPos = -oldEyePos + worldPos.xyz + difVec; 253 253 // don't use difVec here: want to detect if the actual pixel has changed => ssao changed 254 254 //const float3 translatedPos = -oldEyePos + worldPos.xyz; … … 293 293 // means that we only use slight temporal coherence over some frames 294 294 // so that there is no noticeable drag 295 const float pixelCouldBeValid = 4.0f; 295 //const float pixelCouldBeValid = 4.0f; 296 const float pixelCouldBeValid = 100.0f; 296 297 // this pixel information has to be discarded in order to not create artifacts 297 298 const float pixelIsNotValid = 100.0f; … … 305 306 isPixelValid = pixelIsNotValid; 306 307 } 307 else if ( 308 else if (// check if changed from dynamic to not dynamic object 308 309 ( 309 310 // (oldDynamic && !newDynamic) || (!oldDynamic && newDynamic) || … … 321 322 } 322 323 324 isPixelValid = depthDif; 325 323 326 return float2(isPixelValid, abs(oldEyeSpaceDepth - projectedEyeSpaceDepth)); 324 327 } 325 328 326 329 327 /** This function is called during downsampling of the buffers 328 for ssao. 330 /** This function is called during downsampling of the buffers for ssao. 329 331 */ 330 332 pixel PrepareSsao(fragment IN, … … 349 351 color.w /= length(IN.view); 350 352 351 const float4 difVec = tex2Dlod(diffVals, float4(IN.texCoord, 0, 0));353 const float4 difVec = tex2Dlod(diffVals, float4(IN.texCoord, .0f, .0f)); 352 354 // normalize normal once more because of bilinear interpolation 353 355 const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/depthOfField.cg
r3235 r3364 20 20 21 21 const float dist = abs(zFocus - color.w); 22 const float blur = scale * m * focalLen * dist / (sceneRange * (1e-6f + abs(color.w + dist * step(0, zFocus - color.w)))); 22 const float blur = scale * m * focalLen * 23 dist / (sceneRange * (1e-6f + abs(color.w + dist * step(0, zFocus - color.w)))); 23 24 24 25 //float blur = saturate(blur * scale / maxCoC); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3362 r3364 538 538 539 539 total_ao += max(cosAngle, .0f) * aoContrib; 540 541 540 ++ numSamples; 542 541 … … 548 547 // they possibly have any influence on the ao 549 548 550 if ( cosAngle > 0)549 if (1)//cosAngle > 0) 551 550 { 552 551 float pixelValid = sampleColor.x; … … 555 554 { 556 555 const float3 sampleDiffVec = tex2Dlod(attribsTex, float4(texcoord, .0f, .0f)).xyz; 557 pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 10.0f); 556 //pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 100.0f); 557 //pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 4.0f); 558 558 //pixelValid = length(sampleDiffVec - diffVec) < 1e-3f ? .0f : 10.0f; 559 559 } … … 755 755 //if (oldIdx >= factor * newWeight) oldIdx = 0; 756 756 oldWeight = min(oldWeight, factor * newWeight); 757 oldWeight = oldIdx = .0f;757 //oldWeight = oldIdx = .0f; 758 758 } 759 759 } … … 771 771 const float combinedWeight = clamp(newWeight + oldWeight, .0f, temporalCoherence); 772 772 773 OUT.illum_col.y = combinedWeight;773 OUT.illum_col.y = ao.y;//combinedWeight; 774 774 OUT.illum_col.z = oldIdx + newWeight; // the new index 775 775 OUT.illum_col.w = eyeSpaceDepth;
Note: See TracChangeset
for help on using the changeset viewer.