Commit 03a969bf authored by Emma Broman's avatar Emma Broman
Browse files

Fix depth test not working for glyphId framebuffer

We need a depth buffer texture as well
parent 3bef0516
Showing with 20 additions and 0 deletions
+20 -0
......@@ -545,6 +545,25 @@ void RenderableExoplanetGlyphCloud::createGlyphIdTexture(const glm::uvec3 dimens
*_glyphIdTexture,
0
);
// And a depth buffer of the same dimension
_depthTexture = std::make_unique<ghoul::opengl::Texture>(
dimensions,
GL_TEXTURE_2D,
ghoul::opengl::Texture::Format::DepthComponent,
GL_DEPTH_COMPONENT32F,
GL_FLOAT
);
_depthTexture->setFilter(ghoul::opengl::Texture::FilterMode::Linear);
_depthTexture->uploadTexture();
_depthTexture->bind();
glFramebufferTexture(
GL_FRAMEBUFFER,
GL_DEPTH_ATTACHMENT,
*_depthTexture,
0
);
}
void RenderableExoplanetGlyphCloud::mapVertexAttributes() {
......
......@@ -112,6 +112,7 @@ private:
// Point id from screenspace position
std::unique_ptr<ghoul::opengl::Texture> _glyphIdTexture;
std::unique_ptr<ghoul::opengl::Texture> _depthTexture;
GLuint _glyphIdFramebuffer = 0;
glm::ivec2 _lastViewPortSize;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment