From 8a0f7670023396f8131903866f10a5269dec70fa Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 29 Jul 2024 00:08:53 +0300 Subject: [PATCH] disable depth wirte for blended, less or equal depth func for seethrough --- src/rendering/sprites.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/sprites.h b/src/rendering/sprites.h index 54e43e5..88c2c58 100644 --- a/src/rendering/sprites.h +++ b/src/rendering/sprites.h @@ -159,11 +159,11 @@ static void render_sprites(const struct primitive_2d primitives[], glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDepthFunc(GL_ALWAYS); - glDepthMask(GL_TRUE); + glDepthMask(GL_FALSE); glDisable(GL_ALPHA_TEST); } else if (batch.mode == TEXTURE_MODE_SEETHROUGH) { glDisable(GL_BLEND); - glDepthFunc(GL_ALWAYS); + glDepthFunc(GL_LEQUAL); glDepthMask(GL_TRUE); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_EQUAL, 1.0f);