You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Merge pull request #108044 from apples/107935-stencil-fixes
Fix opaque stencil rendering
This commit is contained in:
@@ -359,8 +359,9 @@ void SceneShaderForwardClustered::ShaderData::_create_pipeline(PipelineKey p_pip
|
||||
}
|
||||
}
|
||||
|
||||
depth_stencil_state.enable_stencil = stencil_enabled;
|
||||
if (stencil_enabled) {
|
||||
bool use_stencil = stencil_enabled && p_pipeline_key.version == PIPELINE_VERSION_COLOR_PASS;
|
||||
depth_stencil_state.enable_stencil = use_stencil;
|
||||
if (use_stencil) {
|
||||
static const RD::CompareOperator stencil_compare_rd_table[STENCIL_COMPARE_MAX] = {
|
||||
RD::COMPARE_OP_LESS,
|
||||
RD::COMPARE_OP_EQUAL,
|
||||
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
|
||||
_FORCE_INLINE_ bool uses_shared_shadow_material() const {
|
||||
bool backface_culling = cull_mode == RS::CULL_MODE_BACK;
|
||||
return !uses_particle_trails && !writes_modelview_or_projection && !uses_vertex && !uses_position && !uses_discard && !uses_depth_prepass_alpha && !uses_alpha_clip && !uses_alpha_antialiasing && backface_culling && !uses_point_size && !uses_world_coordinates && !wireframe && !uses_z_clip_scale;
|
||||
return !uses_particle_trails && !writes_modelview_or_projection && !uses_vertex && !uses_position && !uses_discard && !uses_depth_prepass_alpha && !uses_alpha_clip && !uses_alpha_antialiasing && backface_culling && !uses_point_size && !uses_world_coordinates && !wireframe && !uses_z_clip_scale && !stencil_enabled;
|
||||
}
|
||||
|
||||
virtual void set_code(const String &p_Code);
|
||||
|
||||
Reference in New Issue
Block a user