You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #108044 from apples/107935-stencil-fixes
Fix opaque stencil rendering
This commit is contained in:
@@ -2529,7 +2529,6 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
|
||||
scene_state.set_gl_depth_func(GL_GEQUAL);
|
||||
scene_state.enable_gl_scissor_test(false);
|
||||
scene_state.enable_gl_stencil_test(false);
|
||||
scene_state.set_gl_stencil_write_mask(255);
|
||||
|
||||
glColorMask(0, 0, 0, 0);
|
||||
RasterizerGLES3::clear_depth(0.0);
|
||||
@@ -3084,7 +3083,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
|
||||
}
|
||||
|
||||
// Stencil.
|
||||
if (shader->stencil_enabled) {
|
||||
if (p_pass_mode != PASS_MODE_DEPTH && shader->stencil_enabled) {
|
||||
static const GLenum stencil_compare_table[GLES3::SceneShaderData::STENCIL_COMPARE_MAX] = {
|
||||
GL_LESS,
|
||||
GL_EQUAL,
|
||||
@@ -3121,7 +3120,6 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params,
|
||||
scene_state.set_gl_stencil_op(GL_KEEP, stencil_op_dpfail, stencil_op_dppass);
|
||||
} else {
|
||||
scene_state.enable_gl_stencil_test(false);
|
||||
scene_state.set_gl_stencil_write_mask(255);
|
||||
}
|
||||
|
||||
if constexpr (p_pass_mode == PASS_MODE_COLOR || p_pass_mode == PASS_MODE_COLOR_TRANSPARENT) {
|
||||
|
||||
Reference in New Issue
Block a user