Cycles renders black object with smooth shading and negative scale #49310

Closed
opened 2016-09-09 13:53:53 +02:00 by Tautvydas Andrikys · 10 comments

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)
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) ```

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @esminis

Added subscriber: @esminis
Sergey Sharybin was assigned by Bastien Montagne 2016-09-09 14:11:35 +02:00

Added subscriber: @brecht

Added subscriber: @brecht

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 can't reproduce this issue, please provide all the information requested in the [instructions ](https://developer.blender.org/maniphest/task/edit/form/1/), 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 project.xml and I use command

bin/cycles project.xml
I always reproduce it but only on cycles alone (not on whole blender), here is project file [project.xml](https://archive.blender.org/developer/F358317/project.xml) and I use command ``` bin/cycles project.xml ```

Did you manage to reproduce this issue?

Did you manage to reproduce this issue?

This issue was referenced by blender/cycles@9c512fd0b6

This issue was referenced by blender/cycles@9c512fd0b6ff07c26e4a3507abd5c8dac816ad01

This issue was referenced by 335ee5ce5a

This issue was referenced by 335ee5ce5aee3a92415d1608cc66acf3da995598

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

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.

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.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49310
No description provided.