Curve to Mesh node causes other objects to edge split when not shaded smooth #92886

Open
opened 2021-11-06 19:24:45 +01:00 by Erindale · 22 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39

Blender Version
Broken: version: 3.0.0 Beta, branch: master, commit date: 2021-11-05 22:17, hash: 7a5b8cb202
Worked: (newest version of Blender that worked as expected)

Short description of error
When using a Curve to Mesh node, it causes other objects joined to it to be read with each face as a separate mesh island by Cycles (using the Random per Island socket of the Geometry node in shaders). This only happens while using Flat shading AND the Curve to Mesh is plugging into the first position of the Join Geometry node. In any other order it will not happen.
Also happens with more mesh objects as long as the Curve to Mesh object is the first on in the Join node.

The edges aren't actually split, it just seems to be Cycles that thinks they're individual mesh islands.

Exact steps for others to reproduce the error
Add a grid node and join it to a curve going through a Curve to Mesh node.
Ensure the Curve to Mesh is the first connection into the Join Geo node.
Assign a material to the grid and in the shader, view the Random Per Island output of the Geometry node.

2021-11-06 18-08-29.mp4

Mesh Island Bug.blend

**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.39 **Blender Version** Broken: version: 3.0.0 Beta, branch: master, commit date: 2021-11-05 22:17, hash: `7a5b8cb202` Worked: (newest version of Blender that worked as expected) **Short description of error** When using a Curve to Mesh node, it causes other objects joined to it to be read with each face as a separate mesh island by Cycles (using the Random per Island socket of the Geometry node in shaders). This only happens while using Flat shading AND the Curve to Mesh is plugging into the first position of the Join Geometry node. In any other order it will not happen. Also happens with more mesh objects as long as the Curve to Mesh object is the first on in the Join node. The edges aren't actually split, it just seems to be Cycles that thinks they're individual mesh islands. **Exact steps for others to reproduce the error** Add a grid node and join it to a curve going through a Curve to Mesh node. Ensure the Curve to Mesh is the first connection into the Join Geo node. Assign a material to the grid and in the shader, view the Random Per Island output of the Geometry node. [2021-11-06 18-08-29.mp4](https://archive.blender.org/developer/F11752369/2021-11-06_18-08-29.mp4) [Mesh Island Bug.blend](https://archive.blender.org/developer/F11752403/Mesh_Island_Bug.blend)
Author

Added subscriber: @Erindale

Added subscriber: @Erindale

#95619 was marked as duplicate of this issue

#95619 was marked as duplicate of this issue

#94258 was marked as duplicate of this issue

#94258 was marked as duplicate of this issue

Added subscriber: @Osares

Added subscriber: @Osares

Can confirm this is an issue of inconsistency but it is not straight forward if it can be classified as a bug or not as the issue originates from 'auto smooth' flag being enabled in 'Curve to Mesh' node. The same outcome can be achieved on a subdivided plane by enabling the 'auto smooth' setting with flat shading.

The issue(s) to geometry nodes is:

  1. ME_AUTOSMOOTH flag is set in 'blender/source/blender/blenkernel/intern/curve_to_mesh_convert.cc' on row 719.
  2. Only flags from the first mesh instance are copied to the output mesh in the 'Join Geometry' node (which is the reason for the outcome to be order dependent).
  3. ME_AUTOSMOOTH flag is not transferred when applying the geometry modifier.

I am not 100% certain to why auto smooth is enabled or if it changes the result if the mesh is not in 'smooth shading' mode. I'm neither certain what 'auto smooth' achieves when the angel is set to 180* as in 'curve_to_mesh_convert.cc' we have:

719: mesh->flag |= ME_AUTOSMOOTH;
720: mesh->smoothresh = DEG2RADF(180.0f);

To me it looks off and removing/commenting the first of the two lines resolves the issue, but I can't discern if that is a viable solution to this issue.

Screenshot (74).png
In the image the plane circled in blue is a subdivided plane mesh with flat shading and Object Data Properties>Normals>Auto Smooth enabled.

BR

Can confirm this is an issue of inconsistency but it is not straight forward if it can be classified as a bug or not as the issue originates from 'auto smooth' flag being enabled in 'Curve to Mesh' node. The same outcome can be achieved on a subdivided plane by enabling the 'auto smooth' setting with flat shading. The issue(s) to geometry nodes is: 1. ME_AUTOSMOOTH flag is set in 'blender/source/blender/blenkernel/intern/curve_to_mesh_convert.cc' on row 719. 2. Only flags from the first mesh instance are copied to the output mesh in the 'Join Geometry' node (which is the reason for the outcome to be order dependent). 3. ME_AUTOSMOOTH flag is not transferred when applying the geometry modifier. I am not 100% certain to why auto smooth is enabled or if it changes the result if the mesh is not in 'smooth shading' mode. I'm neither certain what 'auto smooth' achieves when the angel is set to 180* as in 'curve_to_mesh_convert.cc' we have: 719: mesh->flag |= ME_AUTOSMOOTH; 720: mesh->smoothresh = DEG2RADF(180.0f); To me it looks off and removing/commenting the first of the two lines resolves the issue, but I can't discern if that is a viable solution to this issue. ![Screenshot (74).png](https://archive.blender.org/developer/F11753544/Screenshot__74_.png) In the image the plane circled in blue is a subdivided plane mesh with flat shading and Object Data Properties>Normals>Auto Smooth enabled. BR

Added subscriber: @erik85

Added subscriber: @erik85

In my patch D12080 (Auto Smooth node) I transfer the flags and smoothresh when the mesh is applied.. Maybe atleast that would be an improvement.

In my patch [D12080](https://archive.blender.org/developer/D12080) (Auto Smooth node) I transfer the flags and smoothresh when the mesh is applied.. Maybe atleast that would be an improvement.

It would at least help, but it does not resolve the inconsistencies that occur here as it would just be another way for multiple values to exist at the same time within the node graph while only a single value can exist in the output (with the modifier applied or otherwise). Finding a general solution to this would probably require defining how these mesh/object-wide flags should be handled as the final outcome in these scenarios will always appear arbitrary for most users?

Cheers

It would at least help, but it does not resolve the inconsistencies that occur here as it would just be another way for multiple values to exist at the same time within the node graph while only a single value can exist in the output (with the modifier applied or otherwise). Finding a general solution to this would probably require defining how these mesh/object-wide flags should be handled as the final outcome in these scenarios will always appear arbitrary for most users? Cheers
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Ref #93208.

Ref #93208.
Member

Added subscriber: @Baardaap

Added subscriber: @Baardaap
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I think we can confirm this report due to inconsistencies.

(Feel free to revert the status)

I think we can confirm this report due to inconsistencies. (Feel free to revert the status)
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

Unfortunately this is a consequence of the (bad in retrospect) decision to output the mesh from the curve to mesh node with the auto smooth flag set.

There may be ways to change this with versioning, but that would have to wait until we can get agreement on #93551 and start implementing those changes.

Unfortunately this is a consequence of the (bad in retrospect) decision to output the mesh from the curve to mesh node with the auto smooth flag set. There may be ways to change this with versioning, but that would have to wait until we can get agreement on #93551 and start implementing those changes.
Member

Added subscriber: @slowburn

Added subscriber: @slowburn
Member

I've closed the other report as it looks identical: #95619
Can't we also add other modules to this report (#render_cycles ?)
Not sure if issue is related to Geometry nodes only

I've closed the other report as it looks identical: #95619 Can't we also add other modules to this report (#render_cycles ?) Not sure if issue is related to Geometry nodes only

Yes, please add Cycles module. This is primarily an issue with Random per Island input and affects all meshes.
The fact that geometry nodes does something weird with smooth shading only makes the problem more visible, but it's not the cause. So it can't be fixed on GN side.

Yes, please add Cycles module. This is primarily an issue with Random per Island input and affects all meshes. The fact that geometry nodes does something weird with smooth shading only makes the problem more visible, but it's not the cause. So it can't be fixed on GN side.
Member

While the result might be the same for both these reports, they are completely unrelated internally and shouldn't be merged. That report shouldn't be classified as a known issue just because this one is.

While the result might be the same for both these reports, they are completely unrelated internally and shouldn't be merged. That report shouldn't be classified as a known issue just because this one is.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Note #72284 (Random Per Island working incorrectly with sharp edges and volumes) is related

Note #72284 (Random Per Island working incorrectly with sharp edges and volumes) is related
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:44:29 +01:00
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
9 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#92886
No description provided.