mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #35729: cycles normal maps not showing properly in preview render.
This commit is contained in:
parent
f173ff531c
commit
f9b06060c2
2 changed files with 7 additions and 4 deletions
|
|
@ -37,7 +37,7 @@ shader node_normal_map(
|
|||
|
||||
getattribute("geom:is_smooth", is_smooth);
|
||||
if (!is_smooth)
|
||||
ninterp = Ng;
|
||||
ninterp = normalize(transform("world", "object", Ng));
|
||||
|
||||
// get _unnormalized_ interpolated normal and tangent
|
||||
if (getattribute(attr_name, tangent) &&
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue