Skip to content

Commit

Permalink
Merge pull request #62432 from RandomShaper/fix_async_hidden_shadow_3.5
Browse files Browse the repository at this point in the history
[3.5] Fix shadows not casted by async hidden materials
  • Loading branch information
clayjohn authored Jun 26, 2022
2 parents 98b4a7c + a46da93 commit ff78e2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_scene_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff78e2d

Please sign in to comment.