Changeset 2898


Ignore:
Timestamp:
09/03/08 10:37:03 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
1 deleted
7 edited

Legend:

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

    r2896 r2898  
    284284                        </File> 
    285285                        <File 
    286                                 RelativePath=".\src\RndGauss.h" 
    287                                 > 
    288                         </File> 
    289                         <File 
    290286                                RelativePath=".\src\SampleGenerator.cpp" 
    291287                                > 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp

    r2897 r2898  
    130130        case DeferredRenderer::GAUSS: 
    131131                { 
    132                         const float radius = 1.0f; 
    133                         const float sigma = 0.25f;//ComputeSigmaFromRadius(1.0f); 
    134  
    135                         static HaltonSequence halton; 
    136  
    137                         for (int i = 0; i < NUM_SAMPLES; ++ i) 
    138                         { 
    139                                 Sample2 s; 
    140                                 Vector3 input; 
    141  
    142                                 halton.GetNext(3, (float *)&input.x); 
    143  
    144                                 //GaussianOn2D(cinput, // input (RND in interval [0-1)x[0-1)) 
    145                                 //               sigma,            // standard deviation of gaussian distribution 
    146                                 //                       outputVec)   // resulting vector according to gaussian distr. 
    147  
    148                                 PolarGaussianOnDisk(input,  // input (RND in interval [0-1)x[0-1)) 
    149                                         sigma,  // standard deviation of gaussian distribution 
    150                                         radius, // standard deviation of gaussian distribution 
    151                                         s);     // result 
    152                                 samples[i] = s; 
    153                         } 
     132                        static GaussianSampleGenerator gauss(NUM_SAMPLES, 0.5f); 
     133                        gauss.Generate((Sample2 *)samples); 
    154134                } 
    155135                break; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp

    r2873 r2898  
    8787        //cout << "minDist after= " << minDist << endl; 
    8888} 
     89 
     90 
     91 
     92GaussianSampleGenerator::GaussianSampleGenerator(int numSamples, float radius): 
     93SampleGenerator(numSamples, radius) 
     94{} 
     95 
     96 
     97void GaussianSampleGenerator::Generate(Sample2 *samples) const 
     98{ 
     99        static HaltonSequence halton; 
     100        float r[2]; 
     101 
     102        const float sigma = mRadius; 
     103 
     104        const float p0 = 1.0f / (sigma * sqrt(2.0f * M_PI)); 
     105        const float p1 = 1.0f / (sigma * sqrt(2.0f * M_PI)); 
     106 
     107        for (int i = 0; i < mNumSamples; ++ i) 
     108        { 
     109                halton.GetNext(2, r); 
     110 
     111                float exp_x = -(r[0] * r[0]) / (2.0f * sigma * sigma); 
     112                float exp_y = -(r[1] * r[1]) / (2.0f * sigma * sigma); 
     113 
     114                samples[i].x = p0 * pow(M_E, exp_x); 
     115                samples[i].y = p1 * pow(M_E, exp_y); 
     116        } 
     117 
     118        //cout << "minDist after= " << minDist << endl; 
     119} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h

    r2886 r2898  
    4242}; 
    4343 
     44 
     45class GaussianSampleGenerator: public SampleGenerator 
     46{ 
     47public: 
     48         
     49        GaussianSampleGenerator(int numSamples, float radius); 
     50 
     51        virtual void Generate(Sample2 *samples) const; 
     52}; 
     53 
     54 
    4455#endif 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/common.h

    r2879 r2898  
    6161#include <values.h> 
    6262#else // __WATCOMC__ 
    63 #define M_PI        3.14159265358979323846F 
    64 #define MAXFLOAT    3.40282347e+37F 
     63#define M_PI 3.14159265358979323846F 
     64#define M_E 2.71828182845904523536F 
     65#define MAXFLOAT 3.40282347e+37F 
    6566#endif // __WATCOMC__ 
    6667 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r2892 r2898  
    88//#define SAMPLE_INTENSITY 0.14f 
    99#define SAMPLE_INTENSITY 0.28f 
     10//#define SAMPLE_INTENSITY 0.9f 
    1011 
    11 //#define AREA_SIZE 50e-1f 
     12//#define AREA_SIZE 20e-1f 
    1213#define AREA_SIZE 5e-1f 
    1314 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2897 r2898  
    194194 
    195195        OUT.illum_col = col * ao.x; 
    196         //OUT.illum_col = ao; 
    197  
    198         //OUT.illum_col.z = ao.z; 
     196        //OUT.illum_col = (float4)ao.x; 
     197 
    199198        OUT.illum_col.w = ao.w; 
    200199 
Note: See TracChangeset for help on using the changeset viewer.