Page MenuHome

Undo in sculpting mode slows down viewport drastically with hires mesh
Closed, ResolvedPublic

Description

System Information
Debian testing, Nvidia GeForce GTX780

Blender Version
Broken: 2.76b (official)

Short description of error
After using undo while sculpting on a hires mesh (about 6 mln polys), viewport rendering slows down drastically.

Exact steps for others to reproduce the error

VBO is active. Global undo is not active. No modifiers. No dynamic sculpting.

  1. Get high amount of polys on a model without modifiers (in attached file you just apply two subsurf modifiers). My card handles up to 20mln just fine, but the bug already appears on 6mln polys.
  2. Step into sculpting mode.
  3. Rotate and pan the viewport to see it's responding very quick.
  4. You can check the speed of the viewport by Alt+a. Mine has 30 fps.
  5. Draw a stroke. The viewport is sill responding as quick as before and the stroke is drawn with no lagging.
  6. Ctrl+z
  7. Rotate and pan the viewport. You'll see a huge performance drop. You can check the Alt+a. Mine has 6 fps.

The count of polygons when the effect is noticeable may vary due to hardware. But with a near-top video card it's noticeable from around 6mln polys.
The problem is not related to the testing cube only. Tested on a complex mesh having 10.5 mln polys also.
I know it may not be a bug, but a drawback of the code design of the undo and/or sculpting system. But it's not desirable for daily use.

Thank you guys!

Event Timeline

Yegor (Yegor) raised the priority of this task from to 90.
Yegor (Yegor) updated the task description. (Show Details)
Yegor (Yegor) edited a custom field.
Yegor (Yegor) added a subscriber: Yegor (Yegor).
Aaron Carlisle (Blendify) lowered the priority of this task from 90 to 30.Jan 26 2016, 7:56 PM

Please test with the latest developmental version of blender which can be downloaded from https://builder.blender.org/download/

I'm confirming the bug is in the latest build from https://builder.blender.org/download/

Hrrrm… debian testing here too, using GTX850m nvidia drivers 340.96 (through primusrun), tried with a 12M tris sphere, viewport is far from fluid then but see absolutely no difference before/after undo.

Please:

  • Try the latest build from our buildbot.
  • Try to start Blender in factory settings (--factory-startup commandline option) (this will ensure whether this is a userpref or addon issue or not).
  • Try to tweak OGL settings in UserPreferences, System tab.
  • Try to tweak your GPU driver settings (e.g. try different values between 'performance' and 'quality' if you have such slider, etc.).
  • Attach as text file here the report generated by Help -> System Info (do not paste it directly in comment).
  • Try to start in software OpenGL mode (use the blender-softwaregl distributed with official blender, will be slow, but will show whether this is a driver issue or not).

Tried all the approaches you've recommended. Still the same.
All the variants of the User Preferences gave no results.
The --factory-startup gave no results.
Nvidia driver is set to max performance with no V-sync. Version 340.96. Updated to 352.79 from repo. Still the same.
Tried software mode and it showed no drop of performance, yes. But i think it's not the driver-only issue, but the way blender works with the driver. Because:

I've tried it under windows machine with the same hardware configuration (my computer) and there is the performance degeneration also. Don't know the drivers version there, but the latest.
I've also tried it on my work machine with a top 12-core i7, 64gb RAM, Nvidia Titan and still have the issue.
Tried on a very slow old laptop with a radeon and there is no this issue so it's nvidia related.

May be i'm doing something wrong still, but here the results...

I think you or someone else should try it on a different machine. On a desktop machine. I'm guessing you're using a laptop.

Attached the system info file

Campbell Barton (campbellbarton) raised the priority of this task from 30 to 50.Feb 12 2016, 8:03 AM

Confirmed, investigating a fix.

The cause of the slowdown is mapping and un-mapping all PBVH VBO's after undo.

Did quite a few tests here and even if none of the data is updated between locking, just locking and unlocking the buffer slows down redraws.

This is definitely a driver issue, switching to nouveau driver for instance, doesn't have this problem.

Checked if others experience this and seems its a known problem.


One obvious solution is not to update all VBO's, though the code isn't setup to make this especially simple.

One workaround I found is to free the ob->derivedFinal entirely on each undo, but this will slowdown systems without this behavior.

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.EditedFeb 13 2016, 9:09 AM

Since this is behavior of the driver we can't entirely avoid locking all buffers - if you paint onto all buffers for example,

Committed checks only to update buffers which are needed, also gives noticable speedup to undo, from a few seconds in my case, to nearly instant.
Fixed/Worked around: rB3ec169527372524b638b6857d62a49e14f15f54c

You guys are really great!

Thank you, Campbell!

I don' t know if this is the same issue or not as this is a windows 10 pro 64 bit machine, but on a 1.8MIL tri mesh, I had lag trying a undo in dynamic sculpt mode that I had to end blender via dev. man.

Blender 2.78a.

Is this related or new ?

I"ll try again later today in case it was a unique bug.

thx