[Bf-blender-cvs] [f31f28c] master: Corrections to world texture coordinates to match the rendered result more closely
Antony Riakiotakis
noreply at git.blender.org
Wed Dec 31 15:00:25 CET 2014
Commit: f31f28c3f452fc1bfe2d4b9ca529e269c914b47e
Author: Antony Riakiotakis
Date: Wed Dec 31 15:00:18 2014 +0100
Branches: master
https://developer.blender.org/rBf31f28c3f452fc1bfe2d4b9ca529e269c914b47e
Corrections to world texture coordinates to match the rendered result
more closely
===================================================================
M source/blender/gpu/shaders/gpu_shader_material.glsl
===================================================================
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 3a04a36..7a4dba5 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;
}
More information about the Bf-blender-cvs
mailing list