gfx: postfx_end use rs
parent
40783980c0
commit
90a7319eaf
|
@ -372685,6 +372685,8 @@ bool postfx_begin(postfx *fx, int width, int height) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static renderstate_t postfx_rs;
|
||||||
|
|
||||||
bool postfx_end(postfx *fx) {
|
bool postfx_end(postfx *fx) {
|
||||||
uint64_t num_active_passes = postfx_active_passes(fx);
|
uint64_t num_active_passes = postfx_active_passes(fx);
|
||||||
bool active = fx->enabled && num_active_passes;
|
bool active = fx->enabled && num_active_passes;
|
||||||
|
@ -372692,12 +372694,16 @@ bool postfx_end(postfx *fx) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_once {
|
||||||
|
postfx_rs = renderstate();
|
||||||
|
// disable depth test in 2d rendering
|
||||||
|
postfx_rs.depth_test_enabled = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// unbind postfx fbo
|
// unbind postfx fbo
|
||||||
fbo_unbind();
|
fbo_unbind();
|
||||||
|
|
||||||
// disable depth test in 2d rendering
|
renderstate_apply(&postfx_rs);
|
||||||
bool is_depth_test_enabled = glIsEnabled(GL_DEPTH_TEST);
|
|
||||||
glDisable(GL_DEPTH_TEST);
|
|
||||||
|
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
float t = time_ms() / 1000.f;
|
float t = time_ms() / 1000.f;
|
||||||
|
@ -372751,9 +372757,6 @@ bool postfx_end(postfx *fx) {
|
||||||
}
|
}
|
||||||
glUseProgram(0);
|
glUseProgram(0);
|
||||||
|
|
||||||
if(is_depth_test_enabled);
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
|
|
||||||
// restore clear color: needed in case transparent window is being used (alpha != 0)
|
// restore clear color: needed in case transparent window is being used (alpha != 0)
|
||||||
glClearColor(0,0,0,1); // @transparent
|
glClearColor(0,0,0,1); // @transparent
|
||||||
|
|
||||||
|
|
|
@ -2610,6 +2610,8 @@ bool postfx_begin(postfx *fx, int width, int height) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static renderstate_t postfx_rs;
|
||||||
|
|
||||||
bool postfx_end(postfx *fx) {
|
bool postfx_end(postfx *fx) {
|
||||||
uint64_t num_active_passes = postfx_active_passes(fx);
|
uint64_t num_active_passes = postfx_active_passes(fx);
|
||||||
bool active = fx->enabled && num_active_passes;
|
bool active = fx->enabled && num_active_passes;
|
||||||
|
@ -2617,12 +2619,16 @@ bool postfx_end(postfx *fx) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_once {
|
||||||
|
postfx_rs = renderstate();
|
||||||
|
// disable depth test in 2d rendering
|
||||||
|
postfx_rs.depth_test_enabled = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// unbind postfx fbo
|
// unbind postfx fbo
|
||||||
fbo_unbind();
|
fbo_unbind();
|
||||||
|
|
||||||
// disable depth test in 2d rendering
|
renderstate_apply(&postfx_rs);
|
||||||
bool is_depth_test_enabled = glIsEnabled(GL_DEPTH_TEST);
|
|
||||||
glDisable(GL_DEPTH_TEST);
|
|
||||||
|
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
float t = time_ms() / 1000.f;
|
float t = time_ms() / 1000.f;
|
||||||
|
@ -2676,9 +2682,6 @@ bool postfx_end(postfx *fx) {
|
||||||
}
|
}
|
||||||
glUseProgram(0);
|
glUseProgram(0);
|
||||||
|
|
||||||
if(is_depth_test_enabled);
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
|
|
||||||
// restore clear color: needed in case transparent window is being used (alpha != 0)
|
// restore clear color: needed in case transparent window is being used (alpha != 0)
|
||||||
glClearColor(0,0,0,1); // @transparent
|
glClearColor(0,0,0,1); // @transparent
|
||||||
|
|
||||||
|
|
15
engine/v4k.c
15
engine/v4k.c
|
@ -19777,6 +19777,8 @@ bool postfx_begin(postfx *fx, int width, int height) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static renderstate_t postfx_rs;
|
||||||
|
|
||||||
bool postfx_end(postfx *fx) {
|
bool postfx_end(postfx *fx) {
|
||||||
uint64_t num_active_passes = postfx_active_passes(fx);
|
uint64_t num_active_passes = postfx_active_passes(fx);
|
||||||
bool active = fx->enabled && num_active_passes;
|
bool active = fx->enabled && num_active_passes;
|
||||||
|
@ -19784,12 +19786,16 @@ bool postfx_end(postfx *fx) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_once {
|
||||||
|
postfx_rs = renderstate();
|
||||||
|
// disable depth test in 2d rendering
|
||||||
|
postfx_rs.depth_test_enabled = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// unbind postfx fbo
|
// unbind postfx fbo
|
||||||
fbo_unbind();
|
fbo_unbind();
|
||||||
|
|
||||||
// disable depth test in 2d rendering
|
renderstate_apply(&postfx_rs);
|
||||||
bool is_depth_test_enabled = glIsEnabled(GL_DEPTH_TEST);
|
|
||||||
glDisable(GL_DEPTH_TEST);
|
|
||||||
|
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
float t = time_ms() / 1000.f;
|
float t = time_ms() / 1000.f;
|
||||||
|
@ -19843,9 +19849,6 @@ bool postfx_end(postfx *fx) {
|
||||||
}
|
}
|
||||||
glUseProgram(0);
|
glUseProgram(0);
|
||||||
|
|
||||||
if(is_depth_test_enabled);
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
|
|
||||||
// restore clear color: needed in case transparent window is being used (alpha != 0)
|
// restore clear color: needed in case transparent window is being used (alpha != 0)
|
||||||
glClearColor(0,0,0,1); // @transparent
|
glClearColor(0,0,0,1); // @transparent
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue