Changeset 3143 for GTP/trunk/App/Demos/Vis
- Timestamp:
- 11/19/08 02:35:37 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3142 r3143 447 447 /////////// 448 448 449 const float filterWidth = 50.0f; 449 const float filterWidth = 100.0f; 450 //const float filterWidth = 1000.0f; 450 451 451 452 #if 1 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3142 r3143 10 10 11 11 // for quadratic falloff 12 //#define SAMPLE_INTENSITY 0. 1f12 //#define SAMPLE_INTENSITY 0.2f 13 13 #define SAMPLE_INTENSITY 0.07f 14 14 //#define SAMPLE_INTENSITY 0.015f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3142 r3143 105 105 sampleTexCoord = float4(texCoord + filterOffs[i] * scale, 0, 0); 106 106 107 108 107 aoSample = tex2Dlod(ssaoTex, sampleTexCoord); 109 108 sampleNorm = normalize(tex2Dlod(normalsTex, sampleTexCoord).xyz); … … 117 116 //sampleDepth = aoSample.w; 118 117 //depthFactor = max(step(1e-1f, 1.0f - abs(1.0f - eyeSpaceDepth / sampleDepth)), 1e-3f); 119 depthFactor = max(1.0f - abs(1.0f - eyeSpaceDepth / sampleDepth), 1e-3f); 118 //depthFactor = max(1.0f - abs(1.0f - eyeSpaceDepth / sampleDepth), 1e-6f); 119 //depthFactor = max(1.0f - abs(1.0f - eyeSpaceDepth / sampleDepth), 1e-6f); 120 121 depthFactor = 1.0f / max(abs(eyeSpaceDepth - sampleDepth), 1e-3f); 120 122 #endif 121 //normalFactor = max(step(0. 9f, dot(sampleNorm, centerNormal)), 1e-3f);122 normalFactor = max(dot(sampleNorm, centerNormal), 1e- 3f);123 convergenceFactor = min( 1000.0f, aoSample.y) * 0.01f;//max(step(18.5f, aoSample.y), 1e-3f);123 //normalFactor = max(step(0.6f, dot(sampleNorm, centerNormal)), 1e-6f); 124 normalFactor = max(dot(sampleNorm, centerNormal), 1e-6f); 125 convergenceFactor = min(200.0f, aoSample.y) * 0.01f;//max(step(18.5f, aoSample.y), 1e-3f); 124 126 125 127 //w = filterWeights[i] * normalFactor * depthFactor * convergenceFactor; 126 w = normalFactor * depthFactor * convergenceFactor; 128 //w = 1000.0f * normalFactor * depthFactor;// * convergenceFactor; 129 //w = normalFactor; 130 w = depthFactor * normalFactor * convergenceFactor; 127 131 //w = filterWeights[i] * normalFactor * converganceFactor; 128 132 //w = filterWeights[i] * normalFactor * depthFactor; … … 130 134 131 135 average += aoSample.x * w; 136 //average += aoSample.x; 132 137 total_w += w; 133 138 } 134 139 135 average *= 1.0f / max(total_w, 1e-1f); 136 137 return saturate(average); 140 average /= max(total_w, 1e-1f); 141 //average /= NUM_SSAO_FILTERSAMPLES; 142 143 return saturate(average ); 138 144 } 139 145 … … 161 167 const float scaleFactor = 1.0f; 162 168 const float adaptFactor = 10.0f; 169 //const float adaptFactor = 500000.0f; 163 170 164 171 //ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); … … 168 175 169 176 const float scale = adaptFactor * scaleFactor * ao.z / (adaptFactor + ao.y); 170 177 //const float scale = scaleFactor * ao.z; 178 171 179 ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, filterWeights, scale, bl, br, tl, tr); 172 180 //if (ao.y < 50.5f) ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, filterWeights, ao.z, bl, br, tl, tr);
Note: See TracChangeset
for help on using the changeset viewer.