diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-13 17:55:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-13 17:55:05 +0400 |
commit | f9b06060c2bd05d8246bc327f0720baf29358bf2 (patch) | |
tree | f6e79ee236743360ab1dd5f04b69145f0dfbe8fb /intern/cycles/kernel/svm/svm_tex_coord.h | |
parent | f173ff531c327f48e8613a28be9850a68ee07627 (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.h | 9 |
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); |