- Timestamp:
- 09/03/08 13:02:39 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r2898 r2899 6 6 #include "Camera.h" 7 7 #include "shaderenv.h" 8 #include "RndGauss.h"9 8 #include "Halton.h" 10 9 #include "ShadowMapping.h" … … 12 11 13 12 using namespace std; 14 15 static GLenum mymrt[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT};16 13 17 14 … … 130 127 case DeferredRenderer::GAUSS: 131 128 { 132 static GaussianSampleGenerator gauss(NUM_SAMPLES, 0.5f); 129 //static GaussianSampleGenerator gauss(NUM_SAMPLES, 0.5f); 130 //gauss.Generate((Sample2 *)samples); 131 132 static SphericalSampleGenerator gauss(NUM_SAMPLES, 0.5f); 133 133 gauss.Generate((Sample2 *)samples); 134 134 } … … 508 508 //mNewFbo->Bind(); 509 509 mFbo->Bind(); 510 glDrawBuffers(1, m ymrt + mFboIndex);510 glDrawBuffers(1, mrt + mFboIndex); 511 511 512 512 … … 657 657 658 658 colorBufferIdx = 3; 659 glDrawBuffers(1, m ymrt + colorBufferIdx);659 glDrawBuffers(1, mrt + colorBufferIdx); 660 660 661 661 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); … … 727 727 mFbo->Bind(); 728 728 729 glDrawBuffers(2, m ymrt + mFboIndex);729 glDrawBuffers(2, mrt + mFboIndex); 730 730 731 731 //GLuint oldSsaoTex = mOldFbo->GetColorBuffer(0)->GetTexture(); … … 819 819 // overwrite old color texture 820 820 colorBufferIdx = 0; 821 glDrawBuffers(1, m ymrt + colorBufferIdx);821 glDrawBuffers(1, mrt + colorBufferIdx); 822 822 823 823 cgGLEnableProfile(RenderState::sCgFragmentProfile); … … 872 872 // overwrite old color texture 873 873 colorBufferIdx = 0; 874 glDrawBuffers(1, m ymrt + colorBufferIdx);874 glDrawBuffers(1, mrt + colorBufferIdx); 875 875 876 876 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); … … 925 925 926 926 colorBufferIdx = 3; 927 glDrawBuffers(1, m ymrt + colorBufferIdx);927 glDrawBuffers(1, mrt + colorBufferIdx); 928 928 929 929 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp
r2884 r2899 9 9 { 10 10 11 GLenum color_attachment[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT};12 11 13 12 void PrintFBOStatus(GLenum status) … … 73 72 74 73 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, internalFormat, w, h); 75 glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, color_attachment[attachment_idx], GL_RENDERBUFFER_EXT, mId);74 glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, mrt[attachment_idx], GL_RENDERBUFFER_EXT, mId); 76 75 77 76 … … 80 79 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, GL_RGBA, glformat, NULL); 81 80 82 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, color_attachment[attachment_idx], GL_TEXTURE_2D, mTexId, 0);81 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, mrt[attachment_idx], GL_TEXTURE_2D, mTexId, 0); 83 82 84 83 GLuint minfilterParam; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h
r2878 r2899 8 8 namespace CHCDemoEngine 9 9 { 10 10 11 11 12 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
r2898 r2899 118 118 //cout << "minDist after= " << minDist << endl; 119 119 } 120 121 122 SphericalSampleGenerator::SphericalSampleGenerator(int numSamples, float radius): 123 SampleGenerator(numSamples, radius) 124 {} 125 126 127 128 129 void SphericalSampleGenerator::Generate(Sample2 *samples) const 130 { 131 static HaltonSequence halton; 132 float r[2]; 133 134 for (int i = 0; i < mNumSamples; ++ i) 135 { 136 halton.GetNext(2, r); 137 138 // create stratified samples over sphere 139 const float rx = r[0]; 140 const float ry = r[1]; 141 142 const float theta = 2.0f * acos(sqrt(1.0f - rx)); 143 const float phi = 2.0f * M_PI * ry; 144 145 float x = sin(theta) * cos(phi); 146 float y = sin(theta) * sin(phi); 147 float z = cos(theta); 148 149 // project to disc 150 samples[i].x = x / z; 151 samples[i].y = y / z; 152 } 153 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h
r2898 r2899 53 53 54 54 55 class SphericalSampleGenerator: public SampleGenerator 56 { 57 public: 58 59 SphericalSampleGenerator(int numSamples, float radius); 60 61 virtual void Generate(Sample2 *samples) const; 62 }; 63 64 55 65 #endif -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp
r2897 r2899 19 19 20 20 21 static GLenum mrt[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT};22 21 23 22 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
r2897 r2899 13 13 { 14 14 15 static GLenum mrt[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT};16 15 17 16 static void PrintGLerror(char *msg) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2897 r2899 232 232 DeferredRenderer *ssaoShader = NULL; 233 233 234 static GLenum mrt[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT};235 234 236 235 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/glInterface.h
r2879 r2899 23 23 #endif 24 24 25 static GLenum mrt[] = {GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_COLOR_ATTACHMENT3_EXT}; 26 27 25 28 #endif // GLINTERFACE_H -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r2898 r2899 8 8 //#define SAMPLE_INTENSITY 0.14f 9 9 #define SAMPLE_INTENSITY 0.28f 10 //#define SAMPLE_INTENSITY 0.9f10 //#define SAMPLE_INTENSITY 1.0f 11 11 12 12 //#define AREA_SIZE 20e-1f
Note: See TracChangeset
for help on using the changeset viewer.