Changeset 3322 for GTP


Ignore:
Timestamp:
02/20/09 18:21:24 (15 years ago)
Author:
mattausch
Message:

found out what is wrong with halton sequence

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  
    196196} 
    197197 
     198QuadraticDiscSampleGenerator2D nixgibts(NUM_SAMPLES, 1.0f); 
    198199 
    199200/** Generate poisson disc distributed sample points on the unit disc 
     
    212213                { 
    213214                        //static QuadraticDiscSampleGenerator2D g(NUM_PRECOMPUTED_SAMPLES, 1.0f); 
     215                        //static QuadraticDiscSampleGenerator2D g(NUM_SAMPLES, 1.0f); 
    214216                        static QuadraticDiscSampleGenerator2D g(NUM_SAMPLES, 1.0f); 
    215217                        g.Generate((float *)samples2); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Halton.cpp

    r3227 r3322  
    4949        } 
    5050 
    51         mIndex %= 100000000; 
     51        //mIndex %= 100000000; 
    5252        return result; 
    5353} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp

    r3313 r3322  
    118118 
    119119 
     120#if 0 
    120121void RandomSampleGenerator2D::Generate(float *samples) const 
    121122{ 
     
    144145} 
    145146 
     147#else 
     148 
     149void 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 
    146186 
    147187SphericalSampleGenerator3D::SphericalSampleGenerator3D(int numSamples, float radius): 
     
    160200                r[1] = RandomValue(0, 1); 
    161201 
    162                 // create stratified samples over sphere 
    163202                const float theta = 2.0f * acos(sqrt(1.0f - r[0])); 
    164203                const float phi = 2.0f * M_PI * r[1]; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3319 r3322  
    99//#define NUM_SAMPLES 16 
    1010//#define NUM_SAMPLES 24 
    11 #define NUM_SAMPLES 48 
     11#define NUM_SAMPLES 8 
    1212 
    1313//#define MIN_SAMPLES 48 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg

    r3319 r3322  
    192192        { 
    193193                // 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); 
    195195        } 
    196196 
     
    232232        { 
    233233                // 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); 
    235235        } 
    236236 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3321 r3322  
    194194                //-- (affects performance for some reason!) 
    195195 
    196                 if (convergence < SSAO_CONVERGENCE_THRESHOLD) 
     196                if (1)//convergence < SSAO_CONVERGENCE_THRESHOLD) 
    197197                { 
    198198                        float2 mynoise = tex2Dlod(noiseTex, float4(IN.texCoord * 4.0f, 0, 0)).xy; 
Note: See TracChangeset for help on using the changeset viewer.