Changeset 3339 for GTP/trunk/App/Demos
- Timestamp:
- 04/10/09 15:46:35 (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/SampleGenerator.cpp
r3338 r3339 91 91 (s[j].y - ry) * (s[j].y - ry); 92 92 93 if (dist < sqrMinDist) 94 sampleValid = false; 93 if (dist < sqrMinDist) sampleValid = false; 95 94 } 96 95 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
r3328 r3339 109 109 const float3 centerPos = ReconstructSamplePos(colorsTex, texCoord, bl, br, tl, tr); 110 110 111 const float scale = 1.0f;//saturate((SSAO_CONVERGENCE_THRESHOLD - convergence) / SSAO_CONVERGENCE_THRESHOLD);111 const float scale = saturate((SSAO_CONVERGENCE_THRESHOLD - convergence) / SSAO_CONVERGENCE_THRESHOLD); 112 112 //const int radius = SSAO_FILTER_RADIUS * saturate((SSAO_CONVERGENCE_THRESHOLD - convergence) / SSAO_CONVERGENCE_THRESHOLD); 113 113 … … 115 115 for (int i = -SSAO_FILTER_RADIUS; i <= SSAO_FILTER_RADIUS; ++ i) 116 116 { 117 float4 sampleTexCoord = float4(texCoord + i * xyStep * scale, .0f, .0f);117 const float4 sampleTexCoord = float4(texCoord + i * xyStep * scale, .0f, .0f); 118 118 result += FilterSample(sampleTexCoord, ssaoTex, colorsTex, centerPos, bl, br, tl, tr, maxConvergence, spatialWeight); 119 119 } 120 120 121 121 result.x /= max(result.y, 1e-6f); 122 123 122 return saturate(result.x); 124 123 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3331 r3339 16 16 }; 17 17 18 19 /*struct pixel20 {21 float4 illum_col: COLOR0;22 };23 */24 18 25 19 struct pixel2 … … 251 245 // angle between current normal and direction to sample controls AO intensity. 252 246 //const float cosAngle2 = dot(-dirSample, sampleNormal); 253 const float cosAngle2 = .5f + dot(sampleNormal, -normal) * 0.5f;247 const float cosAngle2 = .5f + dot(sampleNormal, -normal) * .5f; 254 248 255 249 dirSample *= minDist; … … 257 251 258 252 //const float aoContrib = (1.0f > lengthToSample) ? occlusionPower(9e-2f, DISTANCE_SCALE + lengthToSample): .0f; 259 total_ao += max(cosAngle, .0f) * max(cosAngle2, .0f) * aoContrib; 253 //total_ao += max(cosAngle, .0f) * max(cosAngle2, .0f) * aoContrib; 254 total_ao += max(cosAngle, .0f) * cosAngle2 * aoContrib; 260 255 261 256 ++ numSamples; … … 274 269 #if 1 275 270 const float tooFarAway = step(0.5f, lengthToSample - changeFactor); 276 277 271 const float partlyResetThres = 1.0f; 278 272
Note: See TracChangeset
for help on using the changeset viewer.