Page MenuHome

Cycles renders black object with smooth shading and negative scale
Closed, ResolvedPublic

Description

Cycles renders black object with smooth shading and negative scale. Earlier was similar bug reports in Blender itself, but now this happens in Cycles.

I have managed to trace back and can offer possible fix:

in src/kernel/geom/geom_triangle.h, function triangle_smooth_normal you should invert normal vector if it is negative scale:

normalize((1.0f - u - v)*n2 + u*n0 + v*n1) => -normalize((1.0f - u - v)*n2 + u*n0 + v*n1)

Event Timeline

Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.
Brecht Van Lommel (brecht) triaged this task as 30 priority.Sep 11 2016, 4:38 PM

I can't reproduce this issue, please provide all the information requested in the instructions, with .blend file, Blender version, etc.

We already have some code to handle cases like this, see usage of transform_negative_scale.

I always reproduce it but only on cycles alone (not on whole blender), here is project file

and I use command

bin/cycles project.xml

Did you manage to reproduce this issue?

Should be fixed now, we didn't notice this was broken since we get the normals Blender from usually. The issue was that both the face normal and vertex normal were being flipped, which cancels each other out.

The fix is in the Blender repo, that gets synced into the Cycles repo at some point.