diff options
-rw-r--r-- | intern/cycles/kernel/svm/svm_tex_coord.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/kernel/svm/svm_tex_coord.h b/intern/cycles/kernel/svm/svm_tex_coord.h index a876d6bc916..4fe940f1a67 100644 --- a/intern/cycles/kernel/svm/svm_tex_coord.h +++ b/intern/cycles/kernel/svm/svm_tex_coord.h @@ -268,7 +268,8 @@ ccl_device void svm_node_normal_map(KernelGlobals *kg, ShaderData *sd, float *st if (space == NODE_NORMAL_MAP_TANGENT) { /* tangent space */ if (sd->object == OBJECT_NONE) { - stack_store_float3(stack, normal_offset, make_float3(0.0f, 0.0f, 0.0f)); + /* Fallback to unperturbed normal. */ + stack_store_float3(stack, normal_offset, sd->N); return; } @@ -279,7 +280,8 @@ ccl_device void svm_node_normal_map(KernelGlobals *kg, ShaderData *sd, float *st if (attr.offset == ATTR_STD_NOT_FOUND || attr_sign.offset == ATTR_STD_NOT_FOUND || attr_normal.offset == ATTR_STD_NOT_FOUND) { - stack_store_float3(stack, normal_offset, make_float3(0.0f, 0.0f, 0.0f)); + /* Fallback to unperturbed normal. */ + stack_store_float3(stack, normal_offset, sd->N); return; } |