Maniphest T89794

Wrong shading with non-uniformly scaled objects
Closed, Archived

Assigned To
None
Authored By
Florian (LordoftheFleas)
Jul 11 2021, 5:35 PM
Tags
  • BF Blender
  • Render & Cycles
  • EEVEE & Viewport
Subscribers
Aceto (Aceto)
Brecht Van Lommel (brecht)
Florian (LordoftheFleas)
Philipp Oeser (lichtwerk)

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 980M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 452.06

Blender Version
Broken: version: 2.93.0, branch: master, commit date: 2021-06-02 11:21, hash: rB84da05a8b806
Worked: (newest version of Blender that worked as expected)

Short description of error
Smooth shading is calculated incorrectly for non-uniformly scaled objects (different scaling for different axes)
Issues arise in Viewport and final render (Eevee and Cycles)

Exact steps for others to reproduce the error

Scale any object in edit mode in one axis, then scale it in object mode by the reciprocal value. Set shading to smooth:

Suspected cause: the interpolation within the shading is calculated in edit mode and does not commute with a non-uniform scaling transformation.
Comment: While this may be the intended behavior, it would mean that non-uniform scalings have no application whatsoever as far as rendered objects are concerned.

Event Timeline

Florian (LordoftheFleas) created this task.Jul 11 2021, 5:35 PM
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from Developers.Jul 30 2021, 10:26 AM
Philipp Oeser (lichtwerk) added projects: Render & Cycles, EEVEE & Viewport.
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

Hm, think this might be a limitation (I am not really sure about the cause though, always though normals were not handled in local space, but this might also be precision issues already?).
Will have to get confirmation from rendering devs...

Florian (LordoftheFleas) added a comment.Jul 30 2021, 5:20 PM

always though normals were not handled in local space, but this might also be precision issues already?

I am pretty sure they are handled in local space, you can see this if you turn on autosmooth for an object that is scaled non-uniformly: some edges will get smoothed while others stay sharp although they appear to have the same angle in object mode:

The right object was scaled by a factor of 2 in the x-axis in edit mode and by a factor of 0.5 in object mode, so I guess it's not precision loss at work...

Brecht Van Lommel (brecht) closed this task as Archived.Jul 30 2021, 5:40 PM
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

This is not something we should fix. It is required that normals are computed in local space for instancing to work, and for interop with other apps and file formats which also work like this.

One thing we might do in the future (which some other apps do), is to make scale apply to the mesh vertices by default even when scaling in object mode, since that's nearly always what the user actually wanted to do. But that's outside the scope of the bug tracker.

In general I would recommend not using non-uniform scale at object level with only a few exceptions, in Blender and other 3D apps.

Aceto (Aceto) added a subscriber: Aceto (Aceto).Dec 2 2021, 2:54 PM
This comment was removed by Aceto (Aceto).
Aceto (Aceto) added a comment.Dec 2 2021, 3:14 PM
This comment was removed by Aceto (Aceto).