Merge pull request #62432 from RandomShaper/fix_async_hidden_shadow_3.5

[3.5] Fix shadows not casted by async hidden materials
This commit is contained in:
Clay John 2022-06-26 13:45:58 -07:00 committed by GitHub
commit ff78e2d4c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2325,7 +2325,7 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || ((has_base_alpha || p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_OFF) && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test) {
return; //bye
}
if (!p_material->shader->shader->is_custom_code_ready_for_render(p_material->shader->custom_code_id)) {
if (!p_shadow_pass && !p_material->shader->shader->is_custom_code_ready_for_render(p_material->shader->custom_code_id)) {
// The shader is not guaranteed to be able to render (i.e., a not yet ready async hidden one);
// skip depth rendering because otherwise we risk masking out pixels that won't get written to at the actual render pass
return;