summaryrefslogtreecommitdiff
path: root/drivers/gles3/storage/material_storage.cpp
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-01-03 09:26:15 -0800
committerclayjohn <claynjohn@gmail.com>2023-01-03 12:33:07 -0800
commit062fb8b0dc53bfa1fffb293d6bee5bf7730ddf4c (patch)
treea30a0c898fac858cfba992fca96e54d240ed7454 /drivers/gles3/storage/material_storage.cpp
parent26bed8aa85fc2f98e38552a82929e1deb5b29d8a (diff)
Ignore depth draw optimization when using depth draw alpha prepass
This is necessary as the scene shader still uses alpha in this case so we can't discard fragments that weren't written to the depth buffer
Diffstat (limited to 'drivers/gles3/storage/material_storage.cpp')
-rw-r--r--drivers/gles3/storage/material_storage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp
index ebafdc88d8..53ab3d2367 100644
--- a/drivers/gles3/storage/material_storage.cpp
+++ b/drivers/gles3/storage/material_storage.cpp
@@ -3237,7 +3237,7 @@ void SceneShaderData::set_code(const String &p_code) {
uses_alpha = false;
uses_alpha_clip = false;
uses_blend_alpha = false;
- uses_depth_pre_pass = false;
+ uses_depth_prepass_alpha = false;
uses_discard = false;
uses_roughness = false;
uses_normal = false;
@@ -3288,7 +3288,7 @@ void SceneShaderData::set_code(const String &p_code) {
// Use alpha clip pipeline for alpha hash/dither.
// This prevents sorting issues inherent to alpha blending and allows such materials to cast shadows.
actions.usage_flag_pointers["ALPHA_HASH_SCALE"] = &uses_alpha_clip;
- actions.render_mode_flags["depth_prepass_alpha"] = &uses_depth_pre_pass;
+ actions.render_mode_flags["depth_prepass_alpha"] = &uses_depth_prepass_alpha;
actions.usage_flag_pointers["SSS_STRENGTH"] = &uses_sss;
actions.usage_flag_pointers["SSS_TRANSMITTANCE_DEPTH"] = &uses_transmittance;
@@ -3398,7 +3398,7 @@ bool SceneShaderData::casts_shadows() const {
bool has_base_alpha = (uses_alpha && !uses_alpha_clip) || has_read_screen_alpha;
bool has_alpha = has_base_alpha || uses_blend_alpha;
- return !has_alpha || (uses_depth_pre_pass && !(depth_draw == DEPTH_DRAW_DISABLED || depth_test == DEPTH_TEST_DISABLED));
+ return !has_alpha || (uses_depth_prepass_alpha && !(depth_draw == DEPTH_DRAW_DISABLED || depth_test == DEPTH_TEST_DISABLED));
}
RS::ShaderNativeSourceCode SceneShaderData::get_native_source_code() const {