- Timestamp:
- 09/03/08 10:37:03 (16 years ago)
- 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 284 284 </File> 285 285 <File 286 RelativePath=".\src\RndGauss.h"287 >288 </File>289 <File290 286 RelativePath=".\src\SampleGenerator.cpp" 291 287 > -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r2897 r2898 130 130 case DeferredRenderer::GAUSS: 131 131 { 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); 154 134 } 155 135 break; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
r2873 r2898 87 87 //cout << "minDist after= " << minDist << endl; 88 88 } 89 90 91 92 GaussianSampleGenerator::GaussianSampleGenerator(int numSamples, float radius): 93 SampleGenerator(numSamples, radius) 94 {} 95 96 97 void 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 42 42 }; 43 43 44 45 class GaussianSampleGenerator: public SampleGenerator 46 { 47 public: 48 49 GaussianSampleGenerator(int numSamples, float radius); 50 51 virtual void Generate(Sample2 *samples) const; 52 }; 53 54 44 55 #endif -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/common.h
r2879 r2898 61 61 #include <values.h> 62 62 #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 65 66 #endif // __WATCOMC__ 66 67 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r2892 r2898 8 8 //#define SAMPLE_INTENSITY 0.14f 9 9 #define SAMPLE_INTENSITY 0.28f 10 //#define SAMPLE_INTENSITY 0.9f 10 11 11 //#define AREA_SIZE 50e-1f12 //#define AREA_SIZE 20e-1f 12 13 #define AREA_SIZE 5e-1f 13 14 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2897 r2898 194 194 195 195 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 199 198 OUT.illum_col.w = ao.w; 200 199
Note: See TracChangeset
for help on using the changeset viewer.