Browse Source

Merge pull request #62432 from RandomShaper/fix_async_hidden_shadow_3.5

[3.5] Fix shadows not casted by async hidden materials
Clay John 3 years ago
parent
commit
ff78e2d4c5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gles3/rasterizer_scene_gles3.cpp

+ 1 - 1
drivers/gles3/rasterizer_scene_gles3.cpp

@@ -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;