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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-26 00:28:49 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-09-26 00:28:49 +0400
commitc3d3d8be3675e284cbe269b4173c3cc15ce762ae (patch)
treedeff4134588923edb71ba8f7823562773957f6b7 /source/blender/nodes/shader/node_shader_util.c
parente9859bb0e59cd54a5d682a0fc484e2366d5e54fe (diff)
Fix cycles issue with mapping node rotation and scale order. When using both
scale and rotation in mapping node, there would be shearing, and the only way to avoid that was to add 2 mapping nodes. This is because to transform the texture, the inverse transform needs to be done on the texture coordinate Now the mapping node has Texture/Point/Vector/Normal types to transform the vector for a particular purpose. Point is the existing behavior, Texture is the new default that behaves more like you might expect.
Diffstat (limited to 'source/blender/nodes/shader/node_shader_util.c')
-rw-r--r--source/blender/nodes/shader/node_shader_util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index aed8a0224f1..86e59cd779a 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -271,6 +271,9 @@ void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in
GPUNodeLink *tdomax = GPU_uniform(&domax);
GPU_link(mat, "mapping", in[0].link, tmat, tmin, tmax, tdomin, tdomax, &in[0].link);
+
+ if (texmap->type == TEXMAP_TYPE_NORMAL)
+ GPU_link(mat, "texco_norm", in[0].link, &in[0].link);
}
}