Decimate modifier gives different result on every evaluation #100250
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#100250
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: Linux-5.4.0-122-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.129.06
Blender Version
Broken: version: 3.2.2, branch: master, commit date: 2022-08-02 18:15, hash:
bcfdb14560
, 3.3 latestBroken: 3.1.2
Worked: 3.1.0
Worked: 2.93.8
Caused by
fb2cb0324a
Short description of error
A mesh with decimate modifier gets topology rebuilt on each frame of Cycles render. Notice that a new cones object on the right is not broken.
There's something wrong with the left object. I checked every property I could think of.
0001-0250.mp4
decimate_bug.blend
Exact steps for others to reproduce the error
Open the file. Render a sequence.
Added subscriber: @YegorSmirnov
#101108 was marked as duplicate of this issue
Found a clue. If you change the shadow terminator geometry offset value, the mesh will wiggle in the viewport as well. But setting to 0 doesn't fix the problem on render.
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm, will check
Decimate modifier rebuilds the mesh on each frameto Cycles: Decimate modifier rebuilds the mesh on each frameCycles: Decimate modifier rebuilds the mesh on each frameto Decimate modifier gives different result on every evaluationAdded subscribers: @HooglyBoogly, @brecht
This is not a Cycles or rendering issue, anything to trigger the modifiers to be re-evaluated will change the result, like dragging the Factor slider in the modifier.
fb2cb0324a
enabled multi-threaded vertex normal computation, which gives slightly different results each time due to different order or float addition, which gives different results due to limited precision. The decimation algorithm is sensitive to this.OK, thx checking, just want to note that eevee does not suffer from this (and scratching my head why that is... that is why i was fooled into thinking this is a cycles issue)
So is this something that will have no solution?
CC @HooglyBoogly
Eevee animation render uses "persistent data" automatically, so the mesh is not recreated. So it's not an issue in that case, though if you e.g. distribute that over a render farm it's going to be an issue again.
I think it can be solved. The easy workaround would be to disable multi-threading for computing vertex normals in the decimate modifier.
Ideally vertex normal computation would give consistent results, and perhaps also eliminate the atomic operations. It could store the weighted face normals in an array per-loop, and then threads could sum them per-vertex in some consistent order. This is probably not very efficient though.
Decimation could round away some bits of the vertex normal to remove slight precision differences, though I'm not sure if this will be entirely reliable.
Rounding away the lower bits in vertex normals for decimate sounds like a reasonable approach. I guess that would affect wherever normals are accessed in the decimate modifier.
For making computed normals more consistent, another approach would be caching vertex -> face corner and face corner -> face topology maps in the mesh.
That would be useful for lots of other operations too, and the memory requirement would just be like storing a second MLoop array.
Then the normal calculation would be a simple loop over those indices, without any atomics.
I'm not sure if that should be required for calculating normals though, the current method seems like it has a place too.
Added subscribers: @Deehn, @JacquesLucke, @iss, @sbchild
Added subscriber: @yebutno
Ill just add that information in the opening post that claims 3.1 works is wrong. All 3.x versions have this bug, it is just that it is less severe in 3.1 and below. It works fine only if you go down to 2.93. I am attaching file with simple rock that is very sensitive to this quite frankly critical and workflow breaking bug. I simply use hotkeys to switch between object mode and sculpt mode and the rocks shape drastically changes. I don't understand how something this glaring goes unnoticed by users for so long.
rocks_test.blend
Not sure if it's the same bug, but decimate modifier recalculates on every frame when you add a cloth modifier (even disabled).
2022-11-27 21-58-29_01.mp4
decimate_cloth_bug.blend
This should be solved by
5052e0d407
Indeed, ran the test again and there is no more flickering.