Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-12-31 17:00:18 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-12-31 17:00:18 +0300
commitf31f28c3f452fc1bfe2d4b9ca529e269c914b47e (patch)
tree96f6dc770c5617aa6eb4ed1c53b266d8119f749b
parent01c187fb93cb66244c8edcbb18c8e952c782a9fc (diff)
Corrections to world texture coordinates to match the rendered result
more closely
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 3a04a36cd75..7a4dba5a26a 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2401,11 +2401,11 @@ void node_tex_coord_background(vec3 I, vec3 N, mat4 viewinvmat, mat4 obinvmat,
generated = coords;
normal = -coords;
- uv = attr_uv;
+ uv = vec3(attr_uv.xy, 0.0);
object = coords;
- camera = co.xyz;
- window = mtex_2d_mapping(I);
+ camera = vec3(co.xy, -co.z);
+ window = (gl_ProjectionMatrix[3][3] == 0.0) ? vec3(mtex_2d_mapping(I).xy, 0.0) : vec3(0.5, 0.5, 0.0);
reflection = -coords;
}