- Timestamp:
- 08/25/08 20:20:42 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp
r2865 r2866 78 78 mNewFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 79 79 // the diffuse color buffer 80 mNewFbo->AddColorBuffer( ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false);80 mNewFbo->AddColorBuffer(w, h, ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false); 81 81 82 82 mOldFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE); 83 83 // the diffuse color buffer 84 mOldFbo->AddColorBuffer( ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false);84 mOldFbo->AddColorBuffer(w, h, ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false, false); 85 85 86 86 … … 284 284 285 285 286 /*void SsaoShader::DisplayTexture()287 {288 glEnable(GL_TEXTURE_2D);289 290 glBindTexture(GL_TEXTURE_2D, mNewFbo->GetColorBuffer(0)->GetTexture());291 292 glDisable(GL_LIGHTING);293 294 glMatrixMode(GL_PROJECTION);295 glPushMatrix();296 glLoadIdentity();297 298 glMatrixMode(GL_MODELVIEW);299 glPushMatrix();300 glLoadIdentity();301 302 const float offs = 0.5f;303 glOrtho(-offs, offs, -offs, offs, 0, 1);304 305 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);306 307 glColor4f(1.0f, 1.0f, 1.0f, 1.0f);308 glBegin(GL_QUADS);309 310 glTexCoord2f(0, 0); glVertex3f(-offs, -offs, -0.5f);311 glTexCoord2f(1, 0); glVertex3f( offs, -offs, -0.5f);312 glTexCoord2f(1, 1); glVertex3f( offs, offs, -0.5f);313 glTexCoord2f(0, 1); glVertex3f(-offs, offs, -0.5f);314 315 glEnd();316 317 glEnable(GL_LIGHTING);318 glDisable(GL_TEXTURE_2D);319 320 glMatrixMode(GL_PROJECTION);321 glPopMatrix();322 323 glMatrixMode(GL_MODELVIEW);324 glPopMatrix();325 326 PrintGLerror("ssao second pass");327 }*/328 329 330 286 void SsaoShader::ComputeViewVectors(Vector3 &tl, Vector3 &tr, Vector3 &bl, Vector3 &br) 331 287 { … … 364 320 for (int i = 0; i < mWidth * mHeight * 3; i += 3) 365 321 { 366 // create random samples o ver sphere322 // create random samples on a circle 367 323 const float rx = RandomValue(0, 1); 368 324 const float theta = 2.0f * acos(sqrt(1.0f - rx));
Note: See TracChangeset
for help on using the changeset viewer.