Skip to content
Snippets Groups Projects

Replaced aliased OpenGLExtension calls

Merged Martin Schultz requested to merge featureRemoveExtensions into master
1 file
+ 24
24
Compare changes
  • Side-by-side
  • Inline
+ 24
24
@@ -257,56 +257,56 @@ void SSAOPlugin::reloadResources(int _viewerId, unsigned int _sceneTexWidth, uns
ACG::glCheckErrors();
// create depth render buffer
glGenRenderbuffersEXT(1, &p->depthSSAORenderBuf_);
glGenRenderbuffers(1, &p->depthSSAORenderBuf_);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, p->depthSSAORenderBuf_);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, p->glWidth_, p->glHeight_);
glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, p->glWidth_, p->glHeight_);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
// initialize the fbo
glGenFramebuffersEXT(1, &p->ssaoFbo_);
glGenFramebuffers(1, &p->ssaoFbo_);
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, p->ssaoFbo_);
// color_attachment order:
// scene color, depth, scene normals, occlusion
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, p->depthBufTex_, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, p->sceneNormalTex_, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_TEXTURE_2D, p->occlusionTex_, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, p->depthSSAORenderBuf_);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, p->depthBufTex_, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, p->sceneNormalTex_, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_TEXTURE_2D, p->occlusionTex_, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, p->depthSSAORenderBuf_);
GLenum fboStatus = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
GLenum fboStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
if(fboStatus != GL_FRAMEBUFFER_COMPLETE_EXT)
printf("SSAO Plugin: ssaoFbo failed to initialize\n");
glGenFramebuffersEXT(1, &p->sceneFbo_);
glGenFramebuffers(1, &p->sceneFbo_);
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, p->sceneFbo_);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, p->sceneBufTex_, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, p->sceneBufTex_, 0);
if (p->rtSceneWidth_ > p->rtWidth_ || p->rtSceneHeight_ > p->rtHeight_)
{
// use new depth buffer for multisampling
glGenRenderbuffersEXT(1, &p->depthSceneRenderBuf_);
glGenRenderbuffers(1, &p->depthSceneRenderBuf_);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, p->depthSceneRenderBuf_);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, p->rtSceneWidth_, p->rtSceneHeight_);
glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, p->rtSceneWidth_, p->rtSceneHeight_);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, p->depthSceneRenderBuf_);
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, p->depthSceneRenderBuf_);
}
else
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, p->depthSSAORenderBuf_);
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, p->depthSSAORenderBuf_);
fboStatus = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
fboStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
if(fboStatus != GL_FRAMEBUFFER_COMPLETE_EXT)
printf("SSAO Plugin: sceneFbo failed to initialize\n");
glGenFramebuffersEXT(1, &p->blurFbo_);
glGenFramebuffers(1, &p->blurFbo_);
ACG::GLState::bindFramebuffer(GL_FRAMEBUFFER_EXT, p->blurFbo_);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, p->downsampledTex_, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, p->downsampledTmpTex_, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, p->downsampledTex_, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, p->downsampledTmpTex_, 0);
fboStatus = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
fboStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
if(fboStatus != GL_FRAMEBUFFER_COMPLETE_EXT)
printf("SSAO Plugin: blurFbo failed to initialize\n");
@@ -454,13 +454,13 @@ void SSAOPlugin::destroyResources(int _viewerId)
{
ViewerResources* p = &viewerRes_[_viewerId];
if (p->sceneFbo_) glDeleteFramebuffersEXT(1, &p->sceneFbo_);
if (p->ssaoFbo_) glDeleteFramebuffersEXT(1, &p->ssaoFbo_);
if (p->blurFbo_) glDeleteFramebuffersEXT(1, &p->blurFbo_);
if (p->sceneFbo_) glDeleteFramebuffers(1, &p->sceneFbo_);
if (p->ssaoFbo_) glDeleteFramebuffers(1, &p->ssaoFbo_);
if (p->blurFbo_) glDeleteFramebuffers(1, &p->blurFbo_);
if (p->depthSSAORenderBuf_) glDeleteRenderbuffersEXT(1, &p->depthSSAORenderBuf_);
if (p->depthSSAORenderBuf_) glDeleteRenderbuffers(1, &p->depthSSAORenderBuf_);
if (p->depthSceneRenderBuf_) glDeleteRenderbuffersEXT(1, &p->depthSceneRenderBuf_);
if (p->depthSceneRenderBuf_) glDeleteRenderbuffers(1, &p->depthSceneRenderBuf_);
if (p->sceneBufTex_) glDeleteTextures(1, &p->sceneBufTex_);
if (p->depthBufTex_) glDeleteTextures(1, &p->depthBufTex_);
Loading