Changeset 3332
- Timestamp:
- 03/05/09 18:40:34 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3331 r3332 285 285 static void UpdateSampleTex(Sample2 *samples, int numSamples) 286 286 { 287 PrintGLerror("here4"); 287 288 glEnable(GL_TEXTURE_2D); 288 289 glBindTexture(GL_TEXTURE_2D, sampleTex2D); … … 297 298 tempBuffer[i * 3 + 1] = samples[i].y; 298 299 tempBuffer[i * 3 + 2] = 0; 299 300 300 } 301 301 302 302 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGB, GL_FLOAT, (float *)tempBuffer); 303 303 304 glBindTexture(GL_TEXTURE_2D, 0);304 //glBindTexture(GL_TEXTURE_2D, 0); 305 305 glDisable(GL_TEXTURE_2D); 306 306 … … 309 309 delete [] tempBuffer; 310 310 311 PrintGLerror(" noisetexture");311 PrintGLerror("update sample tex"); 312 312 } 313 313 … … 333 333 tempBuffer[i * 3 + 1] = samples[i].y; 334 334 tempBuffer[i * 3 + 2] = 0; 335 336 335 } 337 336 … … 345 344 delete [] tempBuffer; 346 345 347 PrintGLerror(" noisetexture");346 PrintGLerror("create sample tex"); 348 347 } 349 348 … … 420 419 for (int i = 0; i < 4; ++ i) 421 420 { 422 mIllumFbo->AddColorBuffer(ColorBufferObject::R GBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR);421 mIllumFbo->AddColorBuffer(ColorBufferObject::R_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR); 423 422 FrameBufferObject::InitBuffer(mIllumFbo, i); 424 423 } … … 662 661 if (mShadingMethod != 0) 663 662 { 664 //PrepareSsao(fbo); // downsample fbo buffers663 PrepareSsao(fbo); // downsample fbo buffers 665 664 } 666 665 … … 798 797 void DeferredRenderer::ComputeSsao(FrameBufferObject *fbo, float tempCohFactor) 799 798 { 799 PrintGLerror("here5"); 800 800 801 GLuint colorsTex, normalsTex, attribsTex; 801 802 … … 813 814 attribsTex = fbo->GetColorBuffer(2)->GetTexture(); 814 815 816 PrintGLerror("here6"); 815 817 816 818 ///////// … … 819 821 GLuint oldSsaoTex = mIllumFbo->GetColorBuffer(2 - mIllumFboIndex)->GetTexture(); 820 822 823 PrintGLerror("here809"); 824 821 825 glPushAttrib(GL_VIEWPORT_BIT); 822 826 glViewport(0, 0, mIllumFbo->GetWidth(), mIllumFbo->GetHeight()); 827 828 PrintGLerror("here45"); 823 829 824 830 // read the second buffer, write to the first buffer 825 831 mIllumFbo->Bind(); 826 832 glDrawBuffers(2, mrt + mIllumFboIndex); 833 834 PrintGLerror("here8"); 827 835 828 836 int i = 0; … … 861 869 862 870 sCgSsaoProgram->SetTexture(i, sampleTex2D); 863 864 static int dummycount = 0;865 866 if (0)//dummycount ++ % 1000 == 0)867 {868 float *data = GrabTexture(sampleTex2D, NUM_PRECOMPUTED_SAMPLES, 1);869 cout << "********************************" << endl;870 for (int i = 0; i < NUM_PRECOMPUTED_SAMPLES; ++ i)871 cout << data[i] << " ";872 cout << endl;873 delete [] data;874 }875 871 876 872 ++ i; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp
r3204 r3332 116 116 case RGBA_FLOAT_32: 117 117 mGlFormat = GL_FLOAT; mInternalFormat = GL_RGBA32F_ARB; break; 118 case R_FLOAT_32: 119 //mGlFormat = GL_FLOAT; mInternalFormat = GL_R32F_ARB; break; 118 120 default: 119 121 mGlFormat = GL_UNSIGNED_BYTE; mInternalFormat = GL_RGBA8; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h
r3204 r3332 15 15 public: 16 16 17 enum FORMAT {RGB_UBYTE, RGBA_UBYTE, RGB_FLOAT_16, RGBA_FLOAT_16, RGB_FLOAT_32, RGBA_FLOAT_32 };17 enum FORMAT {RGB_UBYTE, RGBA_UBYTE, RGB_FLOAT_16, RGBA_FLOAT_16, RGB_FLOAT_32, RGBA_FLOAT_32, R_FLOAT_32}; 18 18 enum WRAP_TYPE {WRAP_REPEAT, WRAP_CLAMP_TO_EDGE, WRAP_CLAMP_TO_BORDER}; 19 19 enum FILTER_TYPE {FILTER_NEAREST, FILTER_LINEAR}; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
r3328 r3332 338 338 const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz); 339 339 340 //#ifdef PERFORMANCE_TEST 341 #if 1 340 342 // do reprojection and filter out the pixels that are not save 341 343 const float2 pValid = PixelValid(oldTex, … … 350 352 myTex 351 353 ); 354 #else 355 const float2 pValid = float2(0,0); 356 #endif 352 357 353 358 pix.color = color; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
r3295 r3332 34 34 return rpt; 35 35 } 36 36 37 37 38 struct GiStruct
Note: See TracChangeset
for help on using the changeset viewer.