Changeset 3230 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 12/22/08 16:07:19 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/common.h
r3227 r3230 59 59 return rpt; 60 60 } 61 62 63 #define USE_GTX -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3227 r3230 230 230 // compute position from old frame for dynamic objects + translational portion 231 231 //const float3 translatedPos = difVec - oldEyePos + worldPos.xyz; 232 const float3 translatedPos = - 232 const float3 translatedPos = -oldEyePos + worldPos.xyz; 233 233 234 234 … … 276 276 pixelValid = pixelNotValid; 277 277 } 278 else if ( !((oldEyeSpaceDepth > 1e10f) || (projectedEyeSpaceDepth > 1e10f)) &&278 else if (//!((oldEyeSpaceDepth > 1e10f) || (projectedEyeSpaceDepth > 1e10f)) && 279 279 // check if changed from dynamic to not dynamic object 280 280 ((oldDynamic && !newDynamic) || (!oldDynamic && newDynamic) || 281 281 // check if we have a dynamic object and is a depth discontinuity 282 282 ( 283 //(oldDynamic || newDynamic) && 283 (oldDynamic || newDynamic) && 284 //(depthDif > 1e-5f)))) 284 285 (depthDif > MIN_DEPTH_DIFF)))) 285 286 { -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r3212 r3230 186 186 currentPos /= currentPos.w; 187 187 188 const float currentDepth = currentPos.z * PRECISION_SCALE;188 const float currentDepth = currentPos.z; 189 189 190 190 /////////// … … 203 203 204 204 // the current depth projected into the old frame 205 const float projDepth = projPos.z * PRECISION_SCALE;205 const float projDepth = projPos.z; 206 206 207 207 // fit from unit cube into 0 .. 1 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3227 r3230 93 93 const float depthDif = abs(1.0f - oldEyeSpaceDepth / projectedEyeSpaceDepth); 94 94 95 //const float xOffs = 1.0f / 1024.0f; const float yOffs = 1.0f / 768.0f; const float eps = 1e-6f;96 97 95 // the weight of the accumulated samples from the previous frames 98 96 float w; … … 102 100 103 101 if (1 104 // && (oldTexCoords.x + eps >= xOffs) && (oldTexCoords.x <= 1.0f - xOffs + eps)105 // && (oldTexCoords.y + eps >= yOffs) && (oldTexCoords.y <= 1.0f - yOffs + eps)106 102 && (oldTexCoords.x > 0) && (oldTexCoords.x < 1.0f) 107 103 && (oldTexCoords.y > 0) && (oldTexCoords.y < 1.0f) … … 232 228 float3 tr, 233 229 float3 viewDir, 234 float newWeight,230 float convergence, 235 231 float sampleIntensity, 236 232 bool isMovingObject … … 243 239 for (int i = 0; i < NUM_SAMPLES; ++ i) 244 240 { 245 const float2 offset = samples[i]; 246 247 float2 offsetTransformed; 241 float2 offset; 248 242 249 243 //////////////////// … … 251 245 //-- (affects performance for some reason!) 252 246 253 float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy; 254 //float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord, 0, 0)).xy; 255 //offsetTransformed = myreflect(offset, mynoise); 256 offsetTransformed = myrotate(offset, mynoise.x); 247 if (convergence < 700) 248 { 249 float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy; 250 //offsetTransformed = myreflect(offset, mynoise); 251 offset = myrotate(samples[i], mynoise.x); 252 } 253 else 254 { 255 offset = samples[i]; 256 } 257 257 258 258 // weight with projected coordinate to reach similar kernel size for near and far 259 const float2 texcoord = IN.texCoord.xy + offset Transformed* scaleFactor;259 const float2 texcoord = IN.texCoord.xy + offset * scaleFactor; 260 260 261 261 const float4 sampleColor = tex2Dlod(colors, float4(texcoord, .0f, .0f)); … … 299 299 // we can bail out early and use a minimal #samples) 300 300 // if some conditions are met as long as the hardware supports it 301 if (numSamples >= 8)301 if (numSamples >= MIN_SAMPLES) 302 302 { 303 //break; 303 304 // if the pixel belongs to a static object and all the samples stay valid in the current frame 304 305 if (!isMovingObject && (validSamples < 1.0f)) break; 305 306 // if the pixel belongs to a dynamic object but the #accumulated samples for this pixel is sufficiently high 306 307 // (=> there was no discontinuity recently) 307 else if (isMovingObject && ( newWeight> NUM_SAMPLES * 5)) break;308 else if (isMovingObject && (convergence > NUM_SAMPLES * 5)) break; 308 309 } 309 310 #endif
Note: See TracChangeset
for help on using the changeset viewer.