Changeset 3205
- Timestamp:
- 12/02/08 17:32:17 (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
r3204 r3205 305 305 //-- the flip-flop fbos 306 306 307 //const int dsw = w / 2; const int dsh = h / 2; 308 //const int dsw = 128; const int dsh = 96; 309 const int dsw = 16; const int dsh = 12; 307 const int dsw = w / 2; const int dsh = h / 2; 310 308 //const int dsw = w; const int dsh = h; 311 309 … … 435 433 string combineSsaoParams[] = 436 434 {"colorsTex", "normalsTex", "ssaoTex", "filterOffs", 437 "filterWeights", "modelViewProj", "bl", "br", "tl", "tr" };438 sCgCombineSsaoProgram->AddParameters(combineSsaoParams, 0, 1 0);435 "filterWeights", "modelViewProj", "bl", "br", "tl", "tr", "w", "h"}; 436 sCgCombineSsaoProgram->AddParameters(combineSsaoParams, 0, 12); 439 437 440 438 ////////////// … … 906 904 sCgCombineSsaoProgram->SetValue3f(i, mCornersView[j].x, mCornersView[j].y, mCornersView[j].z); 907 905 906 sCgCombineSsaoProgram->SetValue1f(i ++, mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetWidth()); 907 sCgCombineSsaoProgram->SetValue1f(i ++, mIllumFbo->GetColorBuffer(mIllumFboIndex)->GetHeight()); 908 908 909 DrawQuad(sCgCombineSsaoProgram); 909 910 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3204 r3205 165 165 uniform float3 br, 166 166 uniform float3 tl, 167 uniform float3 tr 167 uniform float3 tr, 168 uniform float3 w, 169 uniform float3 h 168 170 ) 169 171 { … … 177 179 // will be interpolated when upsampling and filter size does not match! 178 180 float4 texelCenterConv; 179 //const float w = 512.0f; const float h = 384.0f;180 //const float w = 128.0f; const float h = 96.0f;181 const float w = 16.0f; const float h = 12.0f;182 181 const float xoffs = .5f / w; const float yoffs = .5f / h; 183 182 … … 186 185 center.x = (floor(IN.texCoord.x * w - .5f) + 1.0f) / w; 187 186 center.y = (floor(IN.texCoord.y * h - .5f) + 1.0f) / h; 188 //center=IN.texCoord; 187 189 188 texelCenterConv.x = tex2Dlod(ssaoTex, float4(center + float2( xoffs, yoffs), 0, 0)).y; 190 189 texelCenterConv.y = tex2Dlod(ssaoTex, float4(center + float2( xoffs, -yoffs), 0, 0)).y; … … 225 224 226 225 //OUT.illum_col.xyz = float3(ao.x, ao.x, step(thres, convergence)); 227 OUT.illum_col.xyz = float3(0, convergence, 0);226 //OUT.illum_col.xyz = float3(0, convergence, 0); 228 227 //OUT.illum_col.xyz = float3(abs(center.x - IN.texCoord.x) * 16.0f, abs(center.y - IN.texCoord.y) * 12.0f, 0); 229 228 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3204 r3205 149 149 { 150 150 // pixel valid => retrieve the convergence weight 151 w = 10.0f;//oldPixel.y;151 w = oldPixel.y; 152 152 } 153 153 else … … 416 416 417 417 const float squaredLen = SqrLen(diffVec); 418 /* 418 419 419 if (ao.y > 4.0f) oldWeight = 0; 420 420 else if ((ao.y > 1.0f) && (squaredLen < DYNAMIC_OBJECTS_THRESHOLD)) 421 421 oldWeight = min(oldWeight, 4.0f * NUM_SAMPLES); 422 */422 423 423 const float newWeight = ao.z; 424 424 425 425 // blend between old and new samples (and avoid division by zero) 426 426 OUT.illum_col.x = (ao.x * newWeight + oldSsao * oldWeight) / max(1e-6f, (newWeight + oldWeight)); 427 OUT.illum_col.y = oldWeight;//clamp(newWeight + oldWeight, .0f, temporalCoherence);427 OUT.illum_col.y = clamp(newWeight + oldWeight, .0f, temporalCoherence); 428 428 429 429 OUT.illum_col.z = SqrLen(diffVec);
Note: See TracChangeset
for help on using the changeset viewer.