Changeset 3112 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 11/09/08 23:06:26 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3111 r3112 6 6 7 7 #define USE_EYESPACE_DEPTH 1 8 //#extension GL_EXT_gpu_shader4 : enable 9 8 10 9 11 … … 130 132 uniform float3 tl, 131 133 uniform float3 tr, 134 float3 projPos, 132 135 float invW, 133 float3 projPos, 134 float4x4 inverseModelTrafo, 136 float4x4 inverseModelTrafos[2], 135 137 float id, 136 138 uniform sampler2D noiseTex, … … 148 150 //////////// 149 151 //-- dynamic objects 150 152 /*float4x4 dummy; 153 uniform mat4 ident = float4x4(1); 154 x = dot(vec, ident[n]); 155 */ 156 float4x4 dummyTrafo = inverseModelTrafos[(int)id]; 151 157 //float4x4 trafo = (id < 10.0f) ? oldModelViewProj : mul(oldModelViewProj, inverseModelTrafo); 152 float4x4 trafo = mul(oldModelViewProj, inverseModelTrafo);158 float4x4 trafo = mul(oldModelViewProj, dummyTrafo); 153 159 154 160 // compute translational portion … … 351 357 uniform float3 oldtr, 352 358 uniform sampler2D attribsTex, 353 uniform float4x4 inverseModelTrafo 359 uniform float4x4 inverseModelTrafos[2] 354 360 ) 355 361 { … … 369 375 370 376 float4 projPos = mul(modelViewProj, eyeSpacePos); 371 const float w = 1.0f / projPos.w;372 projPos *= w;373 float scaleFactor = SAMPLE_RADIUS * w;377 const float invw = 1.0f / projPos.w; 378 projPos *= invw; 379 float scaleFactor = SAMPLE_RADIUS * invw; 374 380 375 381 float2 ao = float2(1.0f, 0); … … 387 393 OUT.illum_col = temporalSmoothing(eyeSpacePos, eyeSpaceDepth, ao, IN.texCoord, oldEyePos, 388 394 oldTex, oldModelViewProj, temporalCoherence, 389 colors, w, bl, br, tl, tr, projPos, inverseModelTrafo, id.z, 390 noiseTex, samples, scaleFactor, oldbl, oldbr, oldtl, oldtr); 395 colors, 396 bl, br, tl, tr, 397 projPos.xyz, 398 invw, 399 inverseModelTrafos, 400 id.z, 401 noiseTex, 402 samples, 403 scaleFactor, 404 oldbl, oldbr, oldtl, oldtr); 391 405 392 406 //OUT.illum_col.xyz = id;
Note: See TracChangeset
for help on using the changeset viewer.