Changeset 3338 for GTP


Ignore:
Timestamp:
03/13/09 17:42:47 (15 years ago)
Author:
mattausch
Message:

worked on sampling

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj

    r3294 r3338  
    156156                                IgnoreAllDefaultLibraries="false" 
    157157                                IgnoreDefaultLibraryNames="LIBCMT" 
    158                                 GenerateDebugInformation="false" 
     158                                GenerateDebugInformation="true" 
    159159                                SubSystem="1" 
    160160                                LargeAddressAware="2" 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r3333 r3338  
    212212} 
    213213 
    214 QuadraticDiscSampleGenerator2D nixgibts(NUM_SAMPLES, 1.0f); 
    215  
    216214/** Generate poisson disc distributed sample points on the unit disc 
    217215*/ 
     
    222220        case DeferredRenderer::SAMPLING_POISSON: 
    223221                { 
    224                         static PoissonDiscSampleGenerator2D poisson(NUM_SAMPLES, 1.0f); 
     222                        PoissonDiscSampleGenerator2D poisson(NUM_PRECOMPUTED_SAMPLES, 1.0f); 
    225223                        poisson.Generate((float *)samples2); 
    226224                } 
     
    228226        case DeferredRenderer::SAMPLING_QUADRATIC: 
    229227                { 
     228                        //PoissonDiscSampleGenerator2D poisson(NUM_PRECOMPUTED_SAMPLES, 1.0f); 
     229                        //poisson.Generate((float *)samples2); 
    230230                        QuadraticDiscSampleGenerator2D g(NUM_PRECOMPUTED_SAMPLES, 1.0f); 
    231                         //static QuadraticDiscSampleGenerator2D g(NUM_SAMPLES, 1.0f); 
    232231                        g.Generate((float *)samples2); 
    233232                } 
     
    235234        default: // SAMPLING_DEFAULT 
    236235                { 
    237                         static RandomSampleGenerator2D g(NUM_SAMPLES, 1.0f); 
     236                        RandomSampleGenerator2D g(NUM_SAMPLES, 1.0f); 
    238237                        g.Generate((float *)samples2); 
    239238                } 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp

    r3329 r3338  
    5151        int tries = 0; 
    5252 
    53         //cout << "minDist before= " << minDist << endl; 
     53        cout << "minDist before= " << minDist << endl; 
    5454        Sample2 *s = (Sample2 *)samples; 
    5555 
     
    6464                        //mHalton->GetNext(r); 
    6565 
     66#if 0 
    6667                        // scale to -1 .. 1 
    6768                        const float rx = r[0] * 2.0f - 1.0f; 
     
    7071                        // check if in disk, else exit early 
    7172                        const float distanceSquared = rx * rx + ry * ry; 
    72  
    73                         if ((rx * rx + ry * ry > mRadius * mRadius)  
    74                                 // also avoid case that sample exactly in center                         
     73                        if (rx * rx + ry * ry > mRadius * mRadius)  
     74                                // also avoid case that sample exactly in center 
    7575                                //|| (distanceSquared <= 1e-3f) 
    76                                 ) 
     76                        { 
    7777                                continue; 
     78                        } 
     79#else 
     80                        const float rx = r[0]; 
     81                        const float ry = r[1]; 
     82#endif 
    7883 
    7984                        bool sampleValid = true; 
     
    109114        } 
    110115 
    111         //cout << "minDist after= " << (float)minDist / mNumSamples<< " #tries: " << tries << endl; 
     116        for (int i = 0; i < mNumSamples; ++ i) 
     117        { 
     118                const float a = 2.0f * M_PI * s[i].x; 
     119                const float r = sqrt(s[i].y); 
     120                 
     121                const float rad = mRadius * r; 
     122 
     123                s[i].x = rad * cos(a); 
     124                s[i].y = rad * sin(a); 
     125        } 
     126 
     127        cout << "minDist after= " << (float)minDist / mNumSamples<< " #tries: " << tries << endl; 
    112128} 
    113129 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3335 r3338  
    11791179                Matrix4x4 rotMatrix2 = RotationZMatrix(rotAngle); 
    11801180                // hack: second buddha 
    1181                 dynamicObjects[3]->GetTransform()->MultMatrix(rotMatrix2); 
     1181                //dynamicObjects[3]->GetTransform()->MultMatrix(rotMatrix2); 
    11821182 
    11831183 
Note: See TracChangeset for help on using the changeset viewer.