stagedraw: disable face culling for 2D rendering

It's never needed, and sometimes we have to re-enable it e.g. for blast
particles. This lets those cases batch together with other sprites.
This commit is contained in:
Andrei Alexeyev 2024-10-03 20:12:39 +02:00
parent b9ee7628ba
commit bc4924ac59
No known key found for this signature in database
GPG key ID: 72D26128040B9690

View file

@ -622,6 +622,7 @@ static bool draw_powersurge_effect(Framebuffer *target_fb, BlendMode blend) {
r_state_push();
r_blend(BLEND_NONE);
r_disable(RCAP_DEPTH_TEST);
r_disable(RCAP_CULL_FACE);
// if(player_is_powersurge_active(&global.plr)) {
r_state_push();
@ -675,6 +676,7 @@ static bool boss_distortion_rule(Framebuffer *fb) {
r_state_push();
r_blend(BLEND_NONE);
r_disable(RCAP_DEPTH_TEST);
r_disable(RCAP_CULL_FACE);
cmplx fpos = global.boss->pos;;
cmplx pos = fpos;
@ -809,6 +811,7 @@ static void stage_render_bg(StageInfo *stage) {
if(should_draw_stage_bg()) {
r_mat_mv_push();
r_enable(RCAP_DEPTH_TEST);
r_enable(RCAP_CULL_FACE);
stage->procs->draw();
r_mat_mv_pop();
fbpair_swap(background);
@ -816,6 +819,7 @@ static void stage_render_bg(StageInfo *stage) {
set_ortho(VIEWPORT_W, VIEWPORT_H);
r_disable(RCAP_DEPTH_TEST);
r_disable(RCAP_CULL_FACE);
apply_bg_shaders(stage->procs->shader_rules, background);