Cycles: Displacement splits flat-shaded faces #114028

Closed
opened 2023-10-22 08:23:45 +02:00 by Sun Kim · 5 comments
Contributor

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.40

Blender Version
Broken: version: 4.1.0 Alpha, branch: PR111187, commit date: 2023-10-20 17:39, hash: 05ff4ce98bce

Caused by something between 4.1.0 Alpha 2023-10-19 22:55 a53dd6e93cfe and 4.1.0 Alpha 2023-10-20 22:28 0bde01eab51c.

Short description of error

Cycles displacement split flat-shaded faces if the mesh has a mix of smooth- and flat-shaded faces.

If all faces are flat-shaded they don't split.

Test file: displacement_split_cycles.blend

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.40 **Blender Version** Broken: version: 4.1.0 Alpha, branch: PR111187, commit date: 2023-10-20 17:39, hash: `05ff4ce98bce` Caused by something between 4.1.0 Alpha 2023-10-19 22:55 `a53dd6e93cfe` and 4.1.0 Alpha 2023-10-20 22:28 `0bde01eab51c`. **Short description of error** Cycles displacement split flat-shaded faces if the mesh has a mix of smooth- and flat-shaded faces. If all faces are flat-shaded they don't split. <video src="/attachments/8d55299e-a1f2-4023-8d2d-df29df2bf2f6" title="displacement_split_cycles.mp4" controls></video> Test file: [displacement_split_cycles.blend](/attachments/0fbc0309-a194-4932-b942-cf43a59e44f5)
Sun Kim added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-10-22 08:23:45 +02:00
Sun Kim changed title from Cycles: displacement split flat-shaded faces to Cycles: Displacement splits flat-shaded faces 2023-10-22 08:25:33 +02:00

Most likely caused by 89e3ba4e25.

CC @HooglyBoogly

Most likely caused by 89e3ba4e25c. CC @HooglyBoogly
Brecht Van Lommel added this to the 4.1 milestone 2023-10-23 12:19:27 +02:00
Member

I don't have a great idea of how to fix this honestly. Maybe displacement could be tweaked to keep these vertices "merged".

The other option is that we're forced to add a "No Split Normals" flag to meshes, but I'd really like to avoid that since it would make edge sharpness disfunctional, meaning we have some of the complexity of auto smooth again.

I don't have a great idea of how to fix this honestly. Maybe displacement could be tweaked to keep these vertices "merged". The other option is that we're forced to add a "No Split Normals" flag to meshes, but I'd really like to avoid that since it would make edge sharpness disfunctional, meaning we have some of the complexity of auto smooth again.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-11-01 11:19:05 +01:00
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2023-11-01 11:19:12 +01:00
Hans Goudey added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-11-01 11:19:19 +01:00
Member

To make it clear, the new state we have now that we didn't have before is that we can have "split" normals (which in Cycles causes splitting of mesh topology at the seams) without explicitly turning on "auto smooth". Options are:

  1. Not a bug. This is just the existing limitation that used to be hidden behind the auto smooth flag.
  2. Somehow use normals averaged per vertex for displacement. Not sure how feasible this is.
  3. Somehow add a post-displacement step for merging vertices-- would require keeping track of vertex indices before the split
  4. Stop splitting edges for split normals and upload per-corner normals to Cycles. Would that require extra branching in shaders?
  5. Always upload per-corner normals to Cycles. Lots of memory usage, yikes!

I don't really view going back to the previous state of "turn on some option if you want this behavior" just hide the problem a proper solution. It would be helpful to have some input from the Cycles team here. I'd also note there might be performance benefits to not altering mesh topology for split shading requirements.

To make it clear, the new state we have now that we didn't have before is that we can have "split" normals (which in Cycles causes splitting of mesh topology at the seams) without explicitly turning on "auto smooth". Options are: 1. Not a bug. This is just the existing limitation that used to be hidden behind the auto smooth flag. 2. Somehow use normals averaged per vertex for displacement. Not sure how feasible this is. 3. Somehow add a post-displacement step for merging vertices-- would require keeping track of vertex indices before the split 4. Stop splitting edges for split normals and upload per-corner normals to Cycles. Would that require extra branching in shaders? 5. Always upload per-corner normals to Cycles. Lots of memory usage, yikes! I don't really view going back to the previous state of "turn on some option if you want this behavior" just hide the problem a proper solution. It would be helpful to have some input from the Cycles team here. I'd also note there might be performance benefits to not altering mesh topology for split shading requirements.

@HooglyBoogly I'll look into adding native support for per-corner normals in Cycles, to avoid splitting the mesh.

@HooglyBoogly I'll look into adding native support for per-corner normals in Cycles, to avoid splitting the mesh.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-01-24 19:56:20 +01:00
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2024-01-24 20:01:33 +01:00

I implemented corner normals in Cycles, but there is a significant increase in memory usage in benchmarks that I'm unhappy about. There are many existing models that have autosmooth enabled for no good reason, and a handful of edges get marked as sharp which affects memory usage for the entire mesh.

I ended up implementing a simpler fix for this specific regression, since I don't want to spend much more time on this now.

There is still a pre-existing issue where sharp edges can also cause artifacts like this bug report. However that is not a regression, so not high priority.

In general, displacement is not really meant to be used with low poly models where you would use these kinds of sharp edges and faces.

I implemented corner normals in Cycles, but there is a significant increase in memory usage in benchmarks that I'm unhappy about. There are many existing models that have autosmooth enabled for no good reason, and a handful of edges get marked as sharp which affects memory usage for the entire mesh. I ended up implementing a simpler fix for this specific regression, since I don't want to spend much more time on this now. There is still a pre-existing issue where sharp edges can also cause artifacts like this bug report. However that is not a regression, so not high priority. In general, displacement is not really meant to be used with low poly models where you would use these kinds of sharp edges and faces.
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
4 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#114028
No description provided.