From 9e4cc5e4f7a3cf85f76634873df70e697e4bcf2a Mon Sep 17 00:00:00 2001 From: Faerbit Date: Thu, 4 Dec 2014 17:39:35 +0100 Subject: [PATCH] Setting wrap mode of depthTextures to CLAMP_TO_EDGE to remove seams. --- graphics.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphics.cc b/graphics.cc index 06f3bf6..a506a64 100644 --- a/graphics.cc +++ b/graphics.cc @@ -35,6 +35,8 @@ void Graphics::init() { depthTexture_near = SharedTexture2D( new Texture2D(windowSize, GL_DEPTH24_STENCIL8)); depthTexture_near->setMinFilter(GL_NEAREST); depthTexture_near->setMagFilter(GL_NEAREST); + depthTexture_near->setWrapS(GL_CLAMP_TO_EDGE); + depthTexture_near->setWrapT(GL_CLAMP_TO_EDGE); depthTexture_near->setCompareMode(GL_COMPARE_REF_TO_TEXTURE); framebuffer_near = SharedFrameBufferObject(new FrameBufferObject()); @@ -44,6 +46,8 @@ void Graphics::init() { depthTexture_middle = SharedTexture2D( new Texture2D(windowSize, GL_DEPTH24_STENCIL8)); depthTexture_middle->setMinFilter(GL_NEAREST); depthTexture_middle->setMagFilter(GL_NEAREST); + depthTexture_middle->setWrapS(GL_CLAMP_TO_EDGE); + depthTexture_middle->setWrapT(GL_CLAMP_TO_EDGE); depthTexture_middle->setCompareMode(GL_COMPARE_REF_TO_TEXTURE); framebuffer_middle = SharedFrameBufferObject(new FrameBufferObject()); @@ -53,6 +57,8 @@ void Graphics::init() { depthTexture_far = SharedTexture2D( new Texture2D(windowSize, GL_DEPTH24_STENCIL8)); depthTexture_far->setMinFilter(GL_NEAREST); depthTexture_far->setMagFilter(GL_NEAREST); + depthTexture_far->setWrapS(GL_CLAMP_TO_EDGE); + depthTexture_far->setWrapT(GL_CLAMP_TO_EDGE); depthTexture_far->setCompareMode(GL_COMPARE_REF_TO_TEXTURE); framebuffer_far = SharedFrameBufferObject(new FrameBufferObject());