diff options
author | Yuri Rubinsky <chaosus89@gmail.com> | 2022-10-19 09:06:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 09:06:50 +0300 |
commit | 61051a44ccacbe447f14538b5bb4b68a62fc896f (patch) | |
tree | 0d368302e124f43754670312f9fc67ed2b4a56cc | |
parent | 4a96fce801cae2d3e0fe42005c74ca7d60cc1582 (diff) | |
parent | 91a9e7af3f03028d769eeda7e8a891ed95667326 (diff) |
Merge pull request #67583 from paddy-exe/fix-distane-fade-node
-rw-r--r-- | scene/resources/visual_shader_nodes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp index de13912b75..a4c958d402 100644 --- a/scene/resources/visual_shader_nodes.cpp +++ b/scene/resources/visual_shader_nodes.cpp @@ -7264,7 +7264,7 @@ String VisualShaderNodeProximityFade::generate_code(Shader::Mode p_mode, VisualS } else { code += " vec4 __depth_world_pos = INV_PROJECTION_MATRIX * vec4(vec3(SCREEN_UV, __depth_tex) * 2.0 - 1.0, 1.0);\n"; } - code += " __depth_world_pos.xyz /= __depth_world_pos.z;\n"; + code += " __depth_world_pos.xyz /= __depth_world_pos.w;\n"; code += vformat(" %s = clamp(1.0 - smoothstep(__depth_world_pos.z + %s, __depth_world_pos.z, VERTEX.z), 0.0, 1.0);\n", p_output_vars[0], p_input_vars[0]); return code; |