Changeset 2886


Ignore:
Timestamp:
08/29/08 20:33:21 (16 years ago)
Author:
mattausch
Message:

using gaussian distribution for sampling

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
2 added
5 edited

Legend:

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

    r2884 r2886  
    292292                        </File> 
    293293                        <File 
     294                                RelativePath=".\src\RndGauss.h" 
     295                                > 
     296                        </File> 
     297                        <File 
    294298                                RelativePath=".\src\SampleGenerator.cpp" 
    295299                                > 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h

    r2853 r2886  
    88struct Sample2 
    99{ 
     10        Sample2() {} 
     11        Sample2(float _x, float _y): x(_x), y(_y) {} 
     12 
    1013        float x;  
    1114        float y; 
     
    3336{ 
    3437public: 
     38         
    3539        PoissonDiscSampleGenerator(int numSamples, float radius); 
    3640 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp

    r2884 r2886  
    66#include "Camera.h" 
    77#include "shaderenv.h" 
     8#include "RndGauss.h" 
     9#include "Halton.h" 
    810 
    911 
     
    1113 
    1214static GLenum mymrt[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT}; 
     15 
    1316 
    1417namespace CHCDemoEngine 
     
    103106static void GenerateSamples() 
    104107{ 
     108#if 0 
    105109        static PoissonDiscSampleGenerator poisson(NUM_SAMPLES, 1.0f); 
    106110        poisson.Generate((Sample2 *)samples); 
     111#else 
     112         
     113        const float radius = 1.0f; 
     114        const float sigma = ComputeSigmaFromRadius(1.0f); 
     115         
     116        static HaltonSequence halton; 
     117 
     118        for (int i = 0; i < NUM_SAMPLES; ++ i) 
     119        { 
     120                Sample2 s; 
     121                Vector3 input; 
     122 
     123                halton.GetNext(3, (float *)&input.x); 
     124 
     125                PolarGaussianOnDisk(input,  // input (RND in interval [0-1)x[0-1)) 
     126                                                    sigma,  // standard deviation of gaussian distribution 
     127                                                        radius, // standard deviation of gaussian distribution 
     128                                                        s);     // result 
     129                samples[i] = s; 
     130        } 
     131#endif 
    107132} 
    108133 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.h

    r2880 r2886  
    8383 
    8484} // namespace  
     85 
    8586#endif // _SsaoShader_H__ 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r2885 r2886  
    2828        // reflect around plane 
    2929        float2 rpt = pt - d * 2.0f * n; 
     30 
    3031        return rpt; 
    3132} 
     
    178179 
    179180        OUT.illum_col = col * ao.x; 
     181        //OUT.illum_col = ao; 
    180182        OUT.illum_col.w = ao.w; 
    181183 
Note: See TracChangeset for help on using the changeset viewer.