Changeset 3231
- Timestamp:
- 12/22/08 18:42:52 (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/DeferredRenderer.cpp
r3227 r3231 71 71 72 72 // ssao random spherical samples 73 static Sample2 samples2[NUM_SAMPLES]; 73 //static Sample2 samples2[NUM_SAMPLES]; 74 #define NUM_PRECOMPUTED_SAMPLES 240 75 static Sample2 samples2[NUM_PRECOMPUTED_SAMPLES]; 74 76 // number of pcf tabs 75 77 static Sample2 pcfSamples[NUM_PCF_TABS]; … … 204 206 case DeferredRenderer::SAMPLING_QUADRATIC: 205 207 { 206 static QuadraticDiscSampleGenerator2D g(NUM_ SAMPLES, 1.0f);208 static QuadraticDiscSampleGenerator2D g(NUM_PRECOMPUTED_SAMPLES, 1.0f); 207 209 g.Generate((float *)samples2); 208 210 } … … 704 706 sCgSsaoProgram->SetValue1f(i ++, (mUseTemporalCoherence && !mRegenerateSamples) ? tempCohFactor : 0); 705 707 708 static int currentPos = 0; 709 706 710 if (mUseTemporalCoherence || mRegenerateSamples) 707 711 { … … 711 715 // in the first case, the sample patterns look nicer, but the kernel 712 716 // needs longer to converge 713 GenerateSamples(mSamplingMethod); 717 if (currentPos + NUM_SAMPLES >= NUM_PRECOMPUTED_SAMPLES) 718 { 719 currentPos = 0; 720 GenerateSamples(mSamplingMethod); 721 } 714 722 715 723 //if (mSortSamples) { SortSamples(); } 716 sCgSsaoProgram->SetArray2f(i, (float *)samples2, NUM_SAMPLES); 724 sCgSsaoProgram->SetArray2f(i, (float *)samples2 + currentPos, NUM_SAMPLES); 725 726 currentPos += NUM_SAMPLES; 717 727 } 718 728 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3230 r3231 245 245 //-- (affects performance for some reason!) 246 246 247 if ( convergence < 700)247 if (1)//convergence < 700) 248 248 { 249 249 float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy;
Note: See TracChangeset
for help on using the changeset viewer.