Bevel modifier creates zero area faces with unexpected normals when clamping to an unbeveled edge. #87433
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#87433
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.79
Blender Version
Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash:
02948a2cab
Worked: I cannot find a working version, I've checked 2.83 and 2.81. (I tried to use 2.79, but I've forgotten how to use it.)
Short description of error
Edit (Baardaap): When the bevel modifier is clamped to an unbeveled edge, it creates a zero area face. This in itself it to be expected and not really a problem though it might be nice to prevent. When you bevel with the bevel operator the same happens. The problem is that the bevel modifier causes a recalculation of all normals, which generates random normals for the zero area faces. These random normals lead to strong shading artifacts when the shading is set to shade smooth.
original report follows:
Inconsistent normal behaviour when using a bevel modifier with
(a) amount exactly matching the face dimension (or is clamped), and
(b) auto smooth off
When compared with auto smooth on, or just bevelling an edge directly.
Exact steps for others to reproduce the error
In the sample file attached, I've created an L shape by creating a plane, then extruding 3 additional edges.
I've added a reflective material to see how the normal affects the reflections.
For each L shape, I've then added a bevel modifier, only changing amount/segments. Or alternatively I've done bevel edge, and only set amount/segments.
Then I've either set to smooth or flat shading, and/or turned-on auto-smooth.
In the attached file, I've prepared the different test scenarios.
From bottom to top:
From left to right:
Amount=1, Segments=3, // this row has no apparent differences
When viewing the file, I find it best to use material preview mode, then orbit up/down, and compare the reflections of the different rows.
My analysis.
When performing a bevel, the faces being bevelled shrink to make space for the bevel, but retain their original normal.
When the bevel amount matches the face size, then those faces still exist, however they have zero size - represented by the red lines.
Using the spreadsheet in 2.93, I can see inconsistencies with the normal vector for these faces.
Here I've set the bevel modifier segments=1, and amount=2.
And the corresponding spreadsheet (annotated).
You'll note that the two empty faces do have valid unit normals, though both a pointing at Z=1.
You would expect the vertical face - [x] to have a normal with X=1.
However if you compare with the reference scenarios like having auto-smooth=on, or applying a bevel edge directly, this is what you see.
In this case, rows 0 and 4 actually have the normal vector set to 0, 0, 0. (I.e. technically an invalid unit vector.)
So, what I believe is happening is that when there is an invalid normal vector, then blender refuses to perform smoothing across from one face to another. The smoothing ends at the bevel edge and the adjacent face in this case is shaded flat.
Getting back to the bevel modifier when auto-smooth is off, while this has valid unit vectors, one of those vectors has the wrong orientation.
This is why there is a reflection anomaly on the vertical face, but not on the horizontal face.
Added subscriber: @MarkStead-2
File demonstrating the problem.
Bevel normal problem.blend
I original found problems when using a bevelled curve - one with a screw modifier.
When I then created the equivalent using mesh edges + screw/bevel (and I had auto-smooth set) the problem went away.
BTW I find it frustrating that there is no auto-smooth for curves. While it may not make sense for a curve directly, it is applicable to a mesh created using modifiers applied to the curve. Perhaps it would be useful to have an AutoSmooth modifier.
Added subscriber: @mano-wii
The result in the file seems to be as expected since the original mesh has some edges clamping the area of influence of the bevel.
This creates some zero-area faces.
It doesn't seem like good practice after all.
The additional edges were added intentionally to show the behavior of the modifier when it is clamped.
The result is different on the vertical face vs the horizonal face (as seen on your animation), and the result differs when bevelling the edge directly.
Added subscriber: @PratikPB2123
Added subscriber: @Baardaap
Changed status from 'Needs Triage' to: 'Confirmed'
I think the difference you see with the horizontal and vertical edges are because your mesh might not be perfectly symmetrical (or because of rounding). When using the manual beveling, this will slide both sides of the bevel completely to the clamping edges, while the bevel modifier always keeps it symmetrical.
But there's definitely something undesirable going on. If I look at the spreadsheet while dragging the beveling amount up & down in the bevel modifier, the two zero-size faces basically get a random normal along one of the cardinal directions. I even got (-1,0,0) for the zero face that had an (1,0,0) normal when it still had a size. Which leads to very wonky transitions.
Though mathematically it is understandable, because the normal vector of a zero-sized face is undefined, this behaviour is very undesirable so I'd say this is confirmed.
It looks like 'manually' beveling the zero sized faces will set the zero sized faces to have a normal of (0,0,0) This breaks the smooth shading. But I think this is actually the expected behaviour, because you have created overlapping edges. However the 'random' normals the bevel modifier creates I'd classify as a bug.
As a workaround you can add a weld modifier after the bevel. That will merge overlapping vertices. It won't always work, but in most cases that fixes it.
Changed status from 'Confirmed' to: 'Archived'
I don't think the fact that Bevel can create zero area faces is a bug. The user has to purposely set some values in the modifier to result in this bad case.
And reanalyzing the result, this is not a bug since it is impossible to calculate the normal of a degenerate face (zero-area face).
So the vertex normal is calculated as if the non-degenerate face were disconnected.
Having zero-area faces in a mesh is bad practice and unpredictable results are kind of to be expected.
So I would refrain from confirming this as a bug.
The bug confirmation was kind of hasty, none of the modules were marked (#modeling, #core...), so no developer was actually informed of the bug to fix.
Also, since this is not a problem with the modifier, the report description would need to be edited to inform the real cause.
So I'm closing the report.
I didn't set out to create a intentionally create a degenerate zero-sized face. This is an entirely likely outcome of using the modifier with the amount set too high.
I had simply observed that the bevel modifier affected the reflections from the flat surfaces - specifically these appeared to now be curved because I guess the smooth shading is just adapting the normal from one face to another. (One face happens to be large, and the other is just a thin sliver of the bevel.)
This behaviour is different when you bevel an edge directly.
In this animation I have removed the additional edges (the ones you don't like) - the object only has 6 vertices. Changing the bevel segments affects the reflection on adjacent faces.
This is why had added the edge loops - and it kind of worked.
Yes, I didn't take care to allow space between the edge loop and the bevel, because I had assumed this is the same scenario as when using Clamp Overlap.
However, looking at this now, it does appear that Clamp Overlap is a slightly different scenario - specifically Clamp Overlap is only necessary when two bevelled edges meet. Whereas this is effectively enforced clamping because the bevel has hit a non-bevelled edge.
For what it's worth, when using Clamp Overlap to limit two adjacent bevels a zero-area face is also created.
While I haven't done extensive testing, it does however appear to retain the original face normal for the zero-area face. As such, there are no reflection anomalies observed at the point where two (clamped) bevels meet.
Look I agree that zero sized faces are bad, so you could argue that the bevel modifier should automatically remove the zero-size faces. Otherwise it doesn't make sense to provide a Clamp Overlap option.
Also bevelling an edge directly does not create zero-area faces. Surely in an ideal world the two should behave the same.
I have tried your suggestion of using the Weld modifier. The behaviour is now like in the gif animation above - specifically the smooth shading now affects the adjacent flat faces making them appear curved.
You say that none of the modules were marked. Was I supposed to do that, or is that done by the Blender team when they triage bugs? Anyway, I can't see how to do that.
Changed status from 'Archived' to: 'Confirmed'
No, the effect is way worse than that. The manual bevel operation works like you describe. The normals of the zeroa-area faces are set to (0,0,0) . I'd argue this is the 'correct', or at least desirable, behaviour.
However in the bevel modifier, the normals of the zero area faces are not set to 0,0,0, but are basically random. Which leads to very weird results if you set smooth shading on.
edit: other format for the video
bevel-bug.mp4
I consider this a bug, because it gives unpredictable results. On large/generated meshes hitting the clamping with a bevel modifier is very common. Unpredictability is a bug IMHO.
So sorry to go against you, but I set it back to confirmed. Sorry for not adding any tags, I forgot.
Normal problem with Bevel modifier when auto smooth offto Bevel modifier creates zero area faces with random normals when clamping to an unbeveled edge.I claim this to do some investigation on the issue. I'm not sure If I can fix it, but I'd like to prevent someone else spending time on it before it's clear that I can't.
Added subscriber: @Raimund58
Added subscriber: @mont29
This has absolutely nothing to do with #core...
Sorry, my mistake. Germano notified me that I had forgotten to add tags like 'Modeling, Core'. I did the stupid and added them both without thinking.
After some investigation and a discussion with the author of the bevel code we've decided this is a 'Known Issue' and very hard to fix, currently.
For now there are 2 options:
Yes, but that's to be expected. That deletes the zero sized faces that shouldn't be there. That's just how smooth shading works.
Bevel modifier creates zero area faces with random normals when clamping to an unbeveled edge.to Bevel modifier creates zero area faces with unexpected normals when clamping to an unbeveled edge.Removed subscriber: @Raimund58
Eh, why removing me as a subscriber?
I am still interested in this task...
Added subscriber: @Raimund58
@Raimund58 So sorry. I confused you with Bastien Montagne. Or rather I misread his post about it having nothing to do with core as coming from you. Luckily you got notified .