Changeset 3321
- Timestamp:
- 02/19/09 17:41:20 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3320 r3321 650 650 positions.push_back(Vector3(6.07307, 8.20723, 6.62)); 651 651 positions.push_back(Vector3(-17.1935, 11.1687, 8.8781)); 652 //positions.push_back(Vector3(499.648, 264.358, 181.7)); 653 //positions.push_back(Vector3(487.913, 285.162, 181.7)); 652 positions.push_back(Vector3(1.50032, 31.1943, 19.1f)); 654 653 655 654 #endif … … 658 657 Matrix4x4 transl = TranslationMatrix(positions[0]); 659 658 660 LoadModel("hbuddha.dem", dynamicObjects); 659 //LoadModel("hbuddha.dem", dynamicObjects); 660 LoadModel("venusm.dem", dynamicObjects); 661 661 662 662 buddha = dynamicObjects.back(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3320 r3321 49 49 // will be interpolated when upsampling and filter size does not match! 50 50 51 float4 texelCenterConv;52 51 const float2 invRes = float2(1.0f / res.x, 1.0f / res.y); 53 52 54 53 // get position exactly between texel centers 55 float2 center = (floor(texCoord * res) + float2(.5f)) * tex elCenterConv;54 float2 center = (floor(texCoord * res) + float2(.5f)) * texCoord; 56 55 //center.x = (floor(texCoord.x * res.x - .5f) + 1.0f) / res.x; 57 56 //center.y = (floor(texCoord.y * res.y - .5f) + 1.0f) / res.y; … … 231 230 232 231 // the normal of the current sample 232 //const float3 sampleNormal = normalize(tex2Dlod(normalTex, float4(texcoord, 0, 0)).xyz); 233 233 const float3 sampleNormal = tex2Dlod(normalTex, float4(texcoord, 0, 0)).xyz; 234 234 235 235 // angle between current normal and direction to sample controls AO intensity. 236 236 float cosAngle2 = .5f + dot(sampleNormal, -normal) * 0.5f; 237 //float cosAngle2 = dot(-dirSample, sampleNormal); 237 238 238 239 //const float aoContrib = sampleIntensity / sqrLen; … … 240 241 241 242 //const float aoContrib = (1.0f > lengthToSample) ? occlusionPower(9e-2f, DISTANCE_SCALE + lengthToSample): .0f; 242 total_ao += max(cosAngle, .0f) * aoContrib * cosAngle2;243 total_ao += max(cosAngle, .0f) * max(cosAngle2, .0f) * aoContrib; 243 244 244 245 ++ numSamples; … … 257 258 #if 1 258 259 const float tooFarAway = step(0.5f, lengthToSample - changeFactor); 259 if (pixelValid < 2.0f) 260 261 const float partlyResetThres = 1.0f; 262 if (0)//pixelValid <= partlyResetThres) 260 263 validSamples = max(validSamples, pixelValid * (1.0f - tooFarAway) * step(-0.1f, cosAngle)); 261 264 else … … 389 392 // to have any influence in the current or last frame 390 393 #if 1 394 const float partlyResetThres = 1.0f; 395 391 396 const float tooFarAway = step(0.5f, lengthToSample - changeFactor); 392 if ( pixelValid < 2.0f)397 if (0)//pixelValid <= partlyResetThres) 393 398 validSamples = max(validSamples, pixelValid * (1.0f - tooFarAway) * step(-0.1f, cosAngle)); 394 399 else
Note: See TracChangeset
for help on using the changeset viewer.