Remove the code here; will be replacing it based on glow effect work.

This commit is contained in:
Andrzej Kapolka 2013-08-15 13:10:48 -07:00
parent 94e5c8d4a1
commit 28d306a228
3 changed files with 4 additions and 66 deletions

View file

@ -3193,7 +3193,7 @@ void Application::displaySide(Camera& whichCamera) {
// Render the world box
if (!_lookingInMirror->isChecked() && _renderStatsOn->isChecked()) { renderWorldBox(); }
_ambientOcclusionEffect.render(_glWidget->width(), _glWidget->height());
_ambientOcclusionEffect.render();
// brad's frustum for debugging
if (_frustumOn->isChecked()) renderViewFrustum(_viewFrustum);

View file

@ -11,60 +11,6 @@
#include "AmbientOcclusionEffect.h"
#include "ProgramObject.h"
ProgramObject* AmbientOcclusionEffect::_program = 0;
AmbientOcclusionEffect::AmbientOcclusionEffect() : _depthTextureID(0) {
}
void AmbientOcclusionEffect::render(int screenWidth, int screenHeight) {
// copy the z buffer into a depth texture
if (_depthTextureID == 0) {
glGenTextures(1, &_depthTextureID);
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, screenWidth, screenHeight, 0);
} else {
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, screenWidth, screenHeight);
}
// now render a full screen quad with that texture
if (_program == 0) {
switchToResourcesParentIfRequired();
_program = new ProgramObject();
_program->addShaderFromSourceFile(QGLShader::Fragment, "resources/shaders/ambient_occlusion.frag");
_program->link();
_program->bind();
_program->setUniformValue("depthTexture", 0);
} else {
_program->bind();
}
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);
glVertex2f(-1.0f, -1.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex2f(1.0f, -1.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex2f(1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex2f(-1.0f, 1.0f);
glEnd();
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
_program->release();
glBindTexture(GL_TEXTURE_2D, 0);
void AmbientOcclusionEffect::render() {
}

View file

@ -16,15 +16,7 @@ class ProgramObject;
class AmbientOcclusionEffect {
public:
AmbientOcclusionEffect();
void render(int screenWidth, int screenHeight);
private:
GLuint _depthTextureID;
static ProgramObject* _program;
void render();
};
#endif /* defined(__interface__AmbientOcclusionEffect__) */