From 470e455091684ca722e61b92b088cd608eb47814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Mon, 15 Apr 2024 16:00:46 +0200 Subject: [PATCH] gfx: more state changes --- engine/joint/v4k.h | 8 +++++--- engine/split/v4k_render.c | 6 ++++-- engine/split/v4k_renderdd.c | 2 +- engine/v4k.c | 8 +++++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index c3daeb2..d251c68 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -385283,9 +385283,11 @@ bool postfx_end(postfx *fx) { do_once { postfx_rs = renderstate(); // disable depth test in 2d rendering - postfx_rs.depth_test_enabled = 1; + postfx_rs.depth_test_enabled = 0; postfx_rs.cull_face_enabled = 0; - postfx_rs.front_face = GL_CCW; + postfx_rs.blend_enabled = 1; + postfx_rs.blend_src = GL_SRC_ALPHA; + postfx_rs.blend_dst = GL_ONE_MINUS_SRC_ALPHA; } // unbind postfx fbo @@ -387205,7 +387207,7 @@ void ddraw_flush() { void ddraw_flush_projview(mat44 proj, mat44 view) { do_once dd_rs = renderstate(); - dd_rs.depth_test_enabled = !dd_ontop; + dd_rs.depth_test_enabled = dd_ontop; dd_rs.cull_face_enabled = 0; glActiveTexture(GL_TEXTURE0); diff --git a/engine/split/v4k_render.c b/engine/split/v4k_render.c index cd168af..4da8d10 100644 --- a/engine/split/v4k_render.c +++ b/engine/split/v4k_render.c @@ -2649,9 +2649,11 @@ bool postfx_end(postfx *fx) { do_once { postfx_rs = renderstate(); // disable depth test in 2d rendering - postfx_rs.depth_test_enabled = 1; + postfx_rs.depth_test_enabled = 0; postfx_rs.cull_face_enabled = 0; - postfx_rs.front_face = GL_CCW; + postfx_rs.blend_enabled = 1; + postfx_rs.blend_src = GL_SRC_ALPHA; + postfx_rs.blend_dst = GL_ONE_MINUS_SRC_ALPHA; } // unbind postfx fbo diff --git a/engine/split/v4k_renderdd.c b/engine/split/v4k_renderdd.c index 158177d..4bcd821 100644 --- a/engine/split/v4k_renderdd.c +++ b/engine/split/v4k_renderdd.c @@ -68,7 +68,7 @@ void ddraw_flush() { void ddraw_flush_projview(mat44 proj, mat44 view) { do_once dd_rs = renderstate(); - dd_rs.depth_test_enabled = !dd_ontop; + dd_rs.depth_test_enabled = dd_ontop; dd_rs.cull_face_enabled = 0; glActiveTexture(GL_TEXTURE0); diff --git a/engine/v4k.c b/engine/v4k.c index 539c35c..5e752d6 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -19823,9 +19823,11 @@ bool postfx_end(postfx *fx) { do_once { postfx_rs = renderstate(); // disable depth test in 2d rendering - postfx_rs.depth_test_enabled = 1; + postfx_rs.depth_test_enabled = 0; postfx_rs.cull_face_enabled = 0; - postfx_rs.front_face = GL_CCW; + postfx_rs.blend_enabled = 1; + postfx_rs.blend_src = GL_SRC_ALPHA; + postfx_rs.blend_dst = GL_ONE_MINUS_SRC_ALPHA; } // unbind postfx fbo @@ -21745,7 +21747,7 @@ void ddraw_flush() { void ddraw_flush_projview(mat44 proj, mat44 view) { do_once dd_rs = renderstate(); - dd_rs.depth_test_enabled = !dd_ontop; + dd_rs.depth_test_enabled = dd_ontop; dd_rs.cull_face_enabled = 0; glActiveTexture(GL_TEXTURE0);