Massive slowdown when animating material in a highpoly mesh #55326
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#55326
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?
Blender Version
Broken:
bda0175984
(blender2.8 HEAD)Short description of error
If you keyframe any material nodetree node input the playback performance suffers severely
Exact steps for others to reproduce the error
wasp_bot.blend
from EEVEE sample files.HEAD
object with a simple emission node.Test playback performance in your system. - It should be fast.
Re-evaluate playback performance - It should be slow.
Note, performance goes back to normal in the following cases:
Added subscriber: @dfelinto
#62176 was marked as duplicate of this issue
Added subscribers: @brecht, @fclem
Adding @brecht as a subscriber too in case he wants to have fun profiling it.
I found the problem:
Also note that the comment on DRW_mesh_batch_cache_dirty about:
This is not correct. If we update the UV and tangent data every time the shader changes this will be also super slow since tangent is the batch slowest to calculate.
This was introduced on
0a57597aff
by the way.Added subscriber: @Sergey
The problem here is that we are missing a more fine grained tagging of the shader nodetree.
As of now, there is no way to know if the user changed a UV channel name in a UV node or just a value of a socket.
The former needs a batch recreation because the needed CD Layers are not the same anymore.
Adding a simple file to reproduce the issue
shading_update_perf.blend
Just open the file and change emission shader color. It should be has fast as when subdiv level is 0.
It should not call BKE_mesh_batch_cache_dirty(object->data, BKE_MESH_BATCH_DIRTY_SHADING) in this instance. Only modifying Tangent/UV maps nodes (and maybe a few others) should do that.
Please note that
7ad8272952
made it at least twice faster already but does not fix the core of the problem.I noticed the same kind of slowness when editing material nodes on high poly meshes.
Fine grained dependency graph tagging seems difficult here, I think it would require compiling the GPU shader to know exactly which mesh attributes are affected by the change.
Would it be possible to not discard the GPU buffers on BKE_MESH_BATCH_DIRTY_SHADING, but rather on draw compare if the requested attributes still match the previous ones?
Added subscribers: @Rawalanche, @ZedDB
@fclem, we've discussed things here at the studio, and the solution was not related to the dependency graph changes.
Let me know if there is something else i can help you here with.
@Sergey Everything on my end has been fixed.
Only removing the batch cache tagging from the depsgraph is needed to fix this issue. I tried to do it but depsgraph was complaining about some missing link thingamajig.
@fclem, just to verify, mind testing P958: (An Untitled Masterwork)
?
@Sergey I confirm it fixes the slowdown.
This issue was referenced by
8955ec6776
Changed status from 'Open' to: 'Resolved'
I've just tested latest build and I can confirm it also fixes the #62176