mirror of
https://github.com/godotengine/godot.git
synced 2025-02-10 21:01:20 +00:00
Use opaque rendering pipeline for alpha hash materials
This has several benefits: - Transparency sorting issues inherent to alpha blending no longer occur. - Alpha hash materials can now cast shadows (also works with GeometryInstance3D Transparency's property for alpha hash materials). - Higher performance.
This commit is contained in:
parent
efcf0d88e4
commit
5d9e996f68
@ -3234,6 +3234,9 @@ void SceneShaderData::set_code(const String &p_code) {
|
||||
|
||||
actions.usage_flag_pointers["ALPHA"] = &uses_alpha;
|
||||
actions.usage_flag_pointers["ALPHA_SCISSOR_THRESHOLD"] = &uses_alpha_clip;
|
||||
// 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.usage_flag_pointers["SSS_STRENGTH"] = &uses_sss;
|
||||
|
@ -111,6 +111,9 @@ void SceneShaderForwardClustered::ShaderData::set_code(const String &p_code) {
|
||||
|
||||
actions.usage_flag_pointers["ALPHA"] = &uses_alpha;
|
||||
actions.usage_flag_pointers["ALPHA_SCISSOR_THRESHOLD"] = &uses_alpha_clip;
|
||||
// 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.usage_flag_pointers["SSS_STRENGTH"] = &uses_sss;
|
||||
|
@ -112,6 +112,9 @@ void SceneShaderForwardMobile::ShaderData::set_code(const String &p_code) {
|
||||
|
||||
actions.usage_flag_pointers["ALPHA"] = &uses_alpha;
|
||||
actions.usage_flag_pointers["ALPHA_SCISSOR_THRESHOLD"] = &uses_alpha_clip;
|
||||
// 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.usage_flag_pointers["SSS_STRENGTH"] = &uses_sss;
|
||||
|
Loading…
Reference in New Issue
Block a user