From c46c527f01e8e2c8f452b3798180959e0c08f9e9 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 11 Jun 2023 09:38:19 +0200 Subject: [PATCH] Backported: [3.x] Fix NODE_POSITION_VIEW Shader Built-In - paddy-exe https://github.com/godotengine/godot/commit/67d3fe4075955bd5eb8892c9610a3b469e81cbc9 --- drivers/gles2/shader_compiler_gles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 873df7284..d29e8ad4a 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -1161,7 +1161,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { actions[RS::SHADER_SPATIAL].renames["NODE_POSITION_WORLD"] = "world_transform[3].xyz"; actions[RS::SHADER_SPATIAL].renames["CAMERA_POSITION_WORLD"] = "camera_matrix[3].xyz"; actions[RS::SHADER_SPATIAL].renames["CAMERA_DIRECTION_WORLD"] = "camera_inverse_matrix[3].xyz"; - actions[RS::SHADER_SPATIAL].renames["NODE_POSITION_VIEW"] = "(world_transform * camera_inverse_matrix)[3].xyz"; + actions[RS::SHADER_SPATIAL].renames["NODE_POSITION_VIEW"] = "(camera_inverse_matrix * world_transform)[3].xyz"; //for light actions[RS::SHADER_SPATIAL].renames["VIEW"] = "view";