Page MenuHome

Sculpt Performance Regression in 2.81
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Windows 10 64 bit
Graphics card: Nvidia GTX 750 Ti

Blender Version
Broken: blender-2.81 eefd806afc15
Worked: blender-2.81 aff6446e064f

Short description of error

Sculpting Performance is noticeably worse.
Especially switching brushes lags.

Exact steps for others to reproduce the error

  1. Open attached file.
  2. Apply the modifiers on the mesh to get a dense mesh.
  3. Enter sculpt mode.
  4. Start sculpting and switch between brushes with keyboard shortcuts.
  5. Experience lag with the newer version.

Event Timeline

The PBVH rebuilds each time the brush radius changes and while modifying mesh properties. This is probably one of the reasons.

I think the problem is in BKE_sculpt_update_object_before_eval. Why is the mesh data updated when changing the brush radius?

Germano Cavalcante (mano-wii) lowered the priority of this task from 90 to 50.Nov 11 2019, 3:51 PM

As noted in D6219 this is caused by rB79b703bb635e: Fix T69822: Switching sculpt objects breaks undo.

Whats happening now is "technically" correct.

  • Brushes & UnifiedPaint request undo.
  • The radial control operator also is flagged to undo.
  • Before writing the memfile undo: sculpt data is flushed to the mesh, otherwise memfile undo would store & load old mesh data, loosing the users sculpt.

Previously sculpt mode prevented all other undo systems from being used, so even when a change required memfile undo to be written, the undo step was written as a sculpt step which did nothing.


It seems users prefer undo to be disabled for brushes (T60640) so here is a patch that disables that D6240: Avoid undo pushes on brush & unified-paint data (addresses T71434).

From my own testing this works without storing undo steps when changing brush/scene/object settings.

Although operators that enable OPTYPE_UNDO and don't use sculpt-undo will write memfile steps.


Note that the fix for T69822: Undo is making objects to disappear in sculpt mode could be reverted, although this re-introduces errors selecting objects while sculpting which mixes up sculpt objects and their undo steps, crashing in some cases.

This problem still exists when changing brush in sculpt mode. Changing brush size is good now.
Changing brush was fast in 2.80 and now its laggy
Exact steps for others to reproduce the error:
Open high poly mesh in sculpt mode and try changing brush

Thanks! Working good now! The only thing is the undo of the first stroke after entering sculpt mode is lagging. If you enter sculpt mode for high poly mesh and make one stroke and then undo is lagging. Don't know if its worth checking