Changeset 3322 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Timestamp:
- 02/20/09 18:21:24 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3319 r3322 196 196 } 197 197 198 QuadraticDiscSampleGenerator2D nixgibts(NUM_SAMPLES, 1.0f); 198 199 199 200 /** Generate poisson disc distributed sample points on the unit disc … … 212 213 { 213 214 //static QuadraticDiscSampleGenerator2D g(NUM_PRECOMPUTED_SAMPLES, 1.0f); 215 //static QuadraticDiscSampleGenerator2D g(NUM_SAMPLES, 1.0f); 214 216 static QuadraticDiscSampleGenerator2D g(NUM_SAMPLES, 1.0f); 215 217 g.Generate((float *)samples2); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Halton.cpp
r3227 r3322 49 49 } 50 50 51 mIndex %= 100000000;51 //mIndex %= 100000000; 52 52 return result; 53 53 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
r3313 r3322 118 118 119 119 120 #if 0 120 121 void RandomSampleGenerator2D::Generate(float *samples) const 121 122 { … … 144 145 } 145 146 147 #else 148 149 void RandomSampleGenerator2D::Generate(float *samples) const 150 { 151 Sample2 *s = (Sample2 *)samples; 152 153 int numSamples = 0; 154 float x[2]; 155 156 static float total1 = 0; 157 static float total2 = 0; 158 static int totalSamples = 0; 159 160 for (int i = 0; i < mNumSamples; ++ i) 161 { 162 //x[0] = RandomValue(0, 1); x[1] = RandomValue(0, 1); 163 mHalton->GetNext(x); 164 165 const float a = 2.0f * M_PI * x[0]; 166 const float r = mRadius * sqrt(x[1]); 167 168 s[i].x = r * cos(a); 169 s[i].y = r * sin(a); 170 171 total1 += x[0]; 172 total2 += x[1]; 173 totalSamples ++; 174 175 if (totalSamples % 1000 == 1) 176 { 177 float n1 = (float)total1 / totalSamples; 178 float n2 = (float)total2 / totalSamples; 179 180 cout << "here3 " << n1 << " " << n2 << endl; 181 } 182 } 183 } 184 185 #endif 146 186 147 187 SphericalSampleGenerator3D::SphericalSampleGenerator3D(int numSamples, float radius): … … 160 200 r[1] = RandomValue(0, 1); 161 201 162 // create stratified samples over sphere163 202 const float theta = 2.0f * acos(sqrt(1.0f - r[0])); 164 203 const float phi = 2.0f * M_PI * r[1]; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3319 r3322 9 9 //#define NUM_SAMPLES 16 10 10 //#define NUM_SAMPLES 24 11 #define NUM_SAMPLES 4811 #define NUM_SAMPLES 8 12 12 13 13 //#define MIN_SAMPLES 48 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
r3319 r3322 192 192 { 193 193 // the filtered ssao value 194 OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight);194 //OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight); 195 195 } 196 196 … … 232 232 { 233 233 // the filtered ssao value 234 ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight);234 //ao.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence, maxConvergence, spatialWeight); 235 235 } 236 236 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3321 r3322 194 194 //-- (affects performance for some reason!) 195 195 196 if ( convergence < SSAO_CONVERGENCE_THRESHOLD)196 if (1)//convergence < SSAO_CONVERGENCE_THRESHOLD) 197 197 { 198 198 float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy;
Note: See TracChangeset
for help on using the changeset viewer.