Changeset 3233 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Timestamp:
- 12/24/08 01:36:00 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3232 r3233 1318 1318 sCgDOFProgram->SetTexture(i ++, colorsTex); 1319 1319 sCgDOFProgram->SetArray2f(i ++, (float *)dofSamples, NUM_DOF_TABS); 1320 sCgDOFProgram->SetValue1f(i ++, sceneRange);1320 sCgDOFProgram->SetValue1f(i ++, mCamera->GetFar() - mCamera->GetNear()); 1321 1321 1322 1322 DrawQuad(sCgDOFProgram); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
r3232 r3233 27 27 void PoissonDiscSampleGenerator2D::Generate(float *samples) const 28 28 { 29 // this is a hacky poisson sampling generator which does random dart-throwing on a disc. 30 // as a savety criterium, the min distance requirement is relaxed if we are not 29 // Poisson disc sampling generator using relaxation 30 // dart-throwing as proposed by McCool et al. 31 // the min distance requirement is relaxed if we are not 31 32 // able to place any dart for a number of tries 32 // the solution is a possion sampling with respect to the adjusted min distance 33 // better solutions have been proposed, i.e., using hierarchical sampling 34 const int maxTries = 1000; 33 // the solution is a possion sampling with respect 34 // to the adjusted min distance 35 // this sampling scheme has the benefit that it is hierarchical 36 int maxTries = 1000; 35 37 const float f_reduction = 0.9f; 36 37 38 38 39 float r[2]; 39 40 40 41 // generates poisson distribution on disc 41 // start with some threshold. best case: all samples lie on the circumference 42 //const float minDist = 2.0f * mRadius / sqrt((float)mNumSamples); 42 // start with some threshold 43 // best case: all samples lie on the circumference of circle 44 43 45 const float eps = 0.2f; 44 46 const float minDist = 2.0f * mRadius * M_PI * (1.0f - eps) / (float)mNumSamples; … … 105 107 } 106 108 107 //cout << "minDist after= " << sqrt(sqrMinDist) << " #tries: " << totalTries << endl;109 cout << "minDist after= " << sqrt(sqrMinDist) << " #tries: " << totalTries << endl; 108 110 } 109 111 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
r3219 r3233 454 454 455 455 transform2LispSM.x[0][0] = 1.0f; 456 transform2LispSM.x[1][2] = 456 transform2LispSM.x[1][2] = -1.0f; // y => -z 457 457 transform2LispSM.x[2][1] = 1.0f; // z => y 458 458 transform2LispSM.x[3][3] = 1.0f; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.h
r3062 r3233 26 26 public: 27 27 /** Constructor taking the scene boundig box and the current camera. 28 The shadow map has resolution size squared.28 The shadow map is quadratic and has resolution mapSize squared. 29 29 */ 30 ShadowMap(DirectionalLight *light, int size, const AxisAlignedBox3 &sceneBox, PerspectiveCamera *cam);30 ShadowMap(DirectionalLight *light, int mapSize, const AxisAlignedBox3 &sceneBox, PerspectiveCamera *cam); 31 31 32 32 ~ShadowMap(); … … 34 34 */ 35 35 void ComputeShadowMap(RenderTraverser *traverser, const Matrix4x4 &projView); 36 /** Renders the scene from shadow view using conventional shading. 37 */ 38 void RenderShadowView(RenderTraverser *renderer, const Matrix4x4 &projView); 36 39 /** Returns computed shadow color texture. 37 40 */ … … 48 51 */ 49 52 void GetTextureMatrix(Matrix4x4 &m) const; 50 /** Return shadowsize.53 /** Returns shadow map size. 51 54 */ 52 55 int GetSize() const { return mSize; } … … 54 57 */ 55 58 PerspectiveCamera *GetShadowCamera() const { return mShadowCam; } 56 /** Renders the scene from shadow view using conventional shading. 57 */ 58 void RenderShadowView(RenderTraverser *renderer, const Matrix4x4 &projView); 59 59 60 /** Draws LispSM intersection body B and the used light frustrum 60 61 */
Note: See TracChangeset
for help on using the changeset viewer.