Merge pull request #101796 from Chaosus/vs_fix_fresnel_preview_bug

Fix visual shader error when opening a Fresnel node preview
This commit is contained in:
Thaddeus Crews 2025-01-20 16:25:47 -06:00
commit cabd792995
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

View file

@ -7261,7 +7261,7 @@ String VisualShaderNodeFresnel::generate_code(Shader::Mode p_mode, VisualShader:
normal = p_input_vars[0];
}
if (p_input_vars[1].is_empty()) {
if (p_mode == Shader::MODE_SPATIAL) {
if (p_mode == Shader::MODE_SPATIAL && !p_for_preview) {
view = "VIEW";
} else {
view = "vec3(0.0)";