summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-20 12:50:30 +0200
committerGitHub <noreply@github.com>2017-10-20 12:50:30 +0200
commitcf5eded9827d7191dc4c2a638353b48199cb6c32 (patch)
treecec2e35d2e1185f1630e6daffc6fed9bb0731472
parenteacdcd7239a52ecb378b752bfd529d4f1f7b3957 (diff)
parente7a370e170a97761a01a1fb537151ff2718afe1a (diff)
Merge pull request #12227 from hi-ogawa/fix-depth-draw-alpha-prepass-for-shadow
Fix depth draw alpha prepass for shadow
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 44a9909bd7..ae4a9d2a03 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -2430,7 +2430,9 @@ void RasterizerStorageGLES3::_update_material(Material *material) {
if (material->shader && material->shader->mode == VS::SHADER_SPATIAL) {
- if (!material->shader->spatial.uses_alpha && material->shader->spatial.blend_mode == Shader::Spatial::BLEND_MODE_MIX) {
+ Shader::Spatial spatial = material->shader->spatial;
+ if (spatial.blend_mode == Shader::Spatial::BLEND_MODE_MIX &&
+ (!spatial.uses_alpha || (spatial.uses_alpha && spatial.depth_draw_mode == Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS))) {
can_cast_shadow = true;
}