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-06-13 17:55:05 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-06-13 17:55:05 +0400
commitf9b06060c2bd05d8246bc327f0720baf29358bf2 (patch)
treef6e79ee236743360ab1dd5f04b69145f0dfbe8fb /intern/cycles/kernel/svm/svm_tex_coord.h
parentf173ff531c327f48e8613a28be9850a68ee07627 (diff)
Fix #35729: cycles normal maps not showing properly in preview render.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_tex_coord.h')
-rw-r--r--intern/cycles/kernel/svm/svm_tex_coord.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/kernel/svm/svm_tex_coord.h b/intern/cycles/kernel/svm/svm_tex_coord.h
index e76b50d6fac..0e4a1530f88 100644
--- a/intern/cycles/kernel/svm/svm_tex_coord.h
+++ b/intern/cycles/kernel/svm/svm_tex_coord.h
@@ -241,10 +241,13 @@ __device void svm_node_normal_map(KernelGlobals *kg, ShaderData *sd, float *stac
float sign = primitive_attribute_float(kg, sd, attr_sign_elem, attr_sign_offset, NULL, NULL);
float3 normal;
- if(sd->shader & SHADER_SMOOTH_NORMAL)
+ if(sd->shader & SHADER_SMOOTH_NORMAL) {
normal = primitive_attribute_float3(kg, sd, attr_normal_elem, attr_normal_offset, NULL, NULL);
- else
- normal = sd->N;
+ }
+ else {
+ normal = sd->Ng;
+ object_inverse_normal_transform(kg, sd, &normal);
+ }
/* apply normal map */
float3 B = sign * cross(normal, tangent);