diff options
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 13 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_environment.c | 4 |
2 files changed, 2 insertions, 15 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 37f9eb0500b..2633c2965b1 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2845,24 +2845,13 @@ void background_transform_to_world(vec3 viewvec, out vec3 worldvec) vec4 co_homogenous = (ProjectionMatrixInverse * v); vec4 co = vec4(co_homogenous.xyz / co_homogenous.w, 0.0); -#ifdef WORLD_BACKGROUND +#if defined(WORLD_BACKGROUND) || defined(PROBE_CAPTURE) worldvec = (ViewMatrixInverse * co).xyz; #else worldvec = (ModelViewMatrixInverse * co).xyz; #endif } -#if defined(PROBE_CAPTURE) || defined(WORLD_BACKGROUND) -void environment_default_vector(out vec3 worldvec) -{ -#ifdef WORLD_BACKGROUND - background_transform_to_world(viewPosition, worldvec); -#else - worldvec = normalize(worldPosition); -#endif -} -#endif - void node_background(vec4 color, float strength, out vec4 result) { result = color * strength; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c index e090f26ab6b..2f8f95b0675 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -69,10 +69,8 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, bNodeE if (type == GPU_MATERIAL_TYPE_MESH) in[0].link = GPU_builtin(GPU_VIEW_POSITION); - else if (type == GPU_MATERIAL_TYPE_WORLD) - GPU_link(mat, "background_transform_to_world", GPU_builtin(GPU_VIEW_POSITION), &in[0].link); else - GPU_link(mat, "environment_default_vector", &in[0].link); + GPU_link(mat, "background_transform_to_world", GPU_builtin(GPU_VIEW_POSITION), &in[0].link); } node_shader_gpu_tex_mapping(mat, node, in, out); |