Sculpt Mode significantly laggy after the addition of Face Sets? #74692

Closed
opened 2020-03-12 19:28:23 +01:00 by Nelson · 30 comments

System Information
Operating system: Windows 10
Graphics card: Quadro M1000M (this is not the best graphics card in the world but it was working great before)
Blender Version
Broken: blender-2.83-8751af6d1902-windows64
Worked: Versions without Face Sets?

Short description of error
Sculpt Mode is very laggy when orbiting the viewport with slightly high poly meshes after the addition of Face Sets. (I think)

Exact steps for others to reproduce the error
Load a high poly mesh in sculpt mode and try to orbit the viewport. For example:
Run blender
Add a multires modifier to the default cube
Subdivide let's say 10 times (you'll have around 6+ millions of polys)
Apply the multires modifier
Still in object mode, try to orbit the viewport. Everything is fine, no big lags.
Now switch to sculpt mode, and try to orbit the viewport. The lag is very notceable. Even the brush cursor (circle) gets laggy most of the time.


It also affects the brush strokes, everything is significantly slower.
It wasn't like this before. Now it's very difficult to sculpt on meshes with this density. 🙁

**System Information** Operating system: Windows 10 Graphics card: Quadro M1000M *(this is not the best graphics card in the world but it was working great before)* **Blender Version** Broken: blender-2.83-8751af6d1902-windows64 Worked: Versions without Face Sets? **Short description of error** Sculpt Mode is very laggy when orbiting the viewport with slightly high poly meshes after the addition of Face Sets. (I think) **Exact steps for others to reproduce the error** Load a high poly mesh in sculpt mode and try to orbit the viewport. For example: Run blender Add a multires modifier to the default cube Subdivide let's say 10 times (you'll have around 6+ millions of polys) Apply the multires modifier Still in object mode, try to orbit the viewport. Everything is fine, no big lags. Now switch to sculpt mode, and try to orbit the viewport. The lag is very notceable. Even the brush cursor (circle) gets laggy most of the time. ___ It also affects the brush strokes, everything is significantly slower. It wasn't like this before. Now it's very difficult to sculpt on meshes with this density. 🙁
Author

Added subscriber: @NelsonNAS

Added subscriber: @NelsonNAS

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Can confirm about 50% FPS drop when switching to sculpt mode.

No problems on quite old c26f470cfe build, tried to bisect this, but I failed on missing libs.

Can confirm about 50% FPS drop when switching to sculpt mode. No problems on quite old c26f470cfeea build, tried to bisect this, but I failed on missing libs.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

I cannot reproduce the problem in 8751af6d19
The sculpt mode fps is even higher (43 fps vs 45 fps)
I suspect this is a graphical issue.


Operating system: Windows-10-10.0.18941 64 Bits
Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.13586 Core Profile Context 19.50.01.05 26.20.15001.5006

I cannot reproduce the problem in `8751af6d19` The sculpt mode fps is even higher (43 fps vs 45 fps) I suspect this is a graphical issue. --- **Operating system:** Windows-10-10.0.18941 64 Bits **Graphics card:** Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.13586 Core Profile Context 19.50.01.05 26.20.15001.5006

Added subscriber: @ThinkingPolygons

Added subscriber: @ThinkingPolygons

I can confirm that too. Massive slowdown in sculpt mode with high poly meshes. 🙁

I can confirm that too. Massive slowdown in sculpt mode with high poly meshes. 🙁

Added subscriber: @PabloDobarro

Added subscriber: @PabloDobarro
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

I can confirm that orbiting the viewport in sculpt mode is slower than in object mode. After orbiting the cursor is laggy for a second or so, and then becomes responsive again. Don't know why that is though.

I can confirm that orbiting the viewport in sculpt mode is slower than in object mode. After orbiting the cursor is laggy for a second or so, and then becomes responsive again. Don't know why that is though.
Member

The lag when entering sculpt mode is probably related to updating all nodes at once and that happens since 2.81. A proposed fix is D6269

If the issue is related to GPU memory usage, D7148 should bring the GPU memory to 2.82 levels. Face Sets are not affecting rendering in any other way as far as I know.

The lag when entering sculpt mode is probably related to updating all nodes at once and that happens since 2.81. A proposed fix is [D6269](https://archive.blender.org/developer/D6269) If the issue is related to GPU memory usage, [D7148](https://archive.blender.org/developer/D7148) should bring the GPU memory to 2.82 levels. Face Sets are not affecting rendering in any other way as far as I know.

Added subscriber: @brecht

Added subscriber: @brecht

@iss confirmed a slowdown compared to c26f470cfe. if that is accurate, then D6269 is unrelated. The bug report description also mentions the default cube, which would not be affected by this unless you closely zoom into it.

Comparing performance differences between object mode and sculpt mode is interesting, but I think this report is about a performance regression when comparng sculpt mode between different Blender versions.

@iss confirmed a slowdown compared to c26f470cfe. if that is accurate, then [D6269](https://archive.blender.org/developer/D6269) is unrelated. The bug report description also mentions the default cube, which would not be affected by this unless you closely zoom into it. Comparing performance differences between object mode and sculpt mode is interesting, but I think this report is about a performance regression when comparng sculpt mode between different Blender versions.
Member

@brecht Does the slowdown also happen with antialiasing disabled? I remember tested the face sets in more than 10M vertices while developing the initial patch and I did not notice any slowdown back then.

@brecht Does the slowdown also happen with antialiasing disabled? I remember tested the face sets in more than 10M vertices while developing the initial patch and I did not notice any slowdown back then.

I'm seeing a performance regression on macOS Intel Iris Graphics 6100, in that it is now always drawing the mask and face sets overlay. Which means drawing the mesh twice, and about half the FPS.

The face sets commit removed this optimization, which would skip drawing the mask for PBVH nodes that have the mask set to zero:

  if (scd->use_mask && !GPU_pbvh_buffers_has_mask(buffers)) {
    return;
  }

If I set a mask to 1 on the entire mesh before the face sets commit, FPS is halved too. I'm not sure if that is the same problem other are seeing, it's easy to check by testing if Mask > Invert Mask causes a similar slowdown in Blender 2.82.

I think that optimization can be added back at least for the case where we know that no face sets exist. I wouldn't even expect the face sets layer to be created at all and use up memory, until a user actually starts using that feature. I don't think we create a mask layer either until it's actually used?

Beyond that, sculpt drawing could be optimized to draw the mask and face set overlay not as part of the overlay engine but as part of workbench, so it doesn't have to draw the mesh twice. That violates the draw manager design, but maybe it's worth it.

I'm seeing a performance regression on macOS Intel Iris Graphics 6100, in that it is now always drawing the mask and face sets overlay. Which means drawing the mesh twice, and about half the FPS. The face sets commit removed this optimization, which would skip drawing the mask for PBVH nodes that have the mask set to zero: ``` if (scd->use_mask && !GPU_pbvh_buffers_has_mask(buffers)) { return; } ``` If I set a mask to 1 on the entire mesh before the face sets commit, FPS is halved too. I'm not sure if that is the same problem other are seeing, it's easy to check by testing if Mask > Invert Mask causes a similar slowdown in Blender 2.82. I think that optimization can be added back at least for the case where we know that no face sets exist. I wouldn't even expect the face sets layer to be created at all and use up memory, until a user actually starts using that feature. I don't think we create a mask layer either until it's actually used? Beyond that, sculpt drawing could be optimized to draw the mask and face set overlay not as part of the overlay engine but as part of workbench, so it doesn't have to draw the mesh twice. That violates the draw manager design, but maybe it's worth it.

A crude way to measure FPS is:

  • Set scene FPS to 120.
  • Choose number of multires levels so the number is well below whatever the FPS cap is due to monitor refresh rate (usually 60)
  • Press space for animation playback
A crude way to measure FPS is: * Set scene FPS to 120. * Choose number of multires levels so the number is well below whatever the FPS cap is due to monitor refresh rate (usually 60) * Press space for animation playback
Member

But now face sets store the mesh visibility, so all tools assume that the layer is always there. We could maybe try to skip the rendering of the overlay if there is no mask and if we are only rendering the default face set (it is just using a white color, the face set is still there), but that sounds like a hack.
Ideally, the state of the mask and the face sets should not affect performance at all, so fps should also not drop when the object is fully masked. Can we consider rendering everything in a single draw from workbench?

But now face sets store the mesh visibility, so all tools assume that the layer is always there. We could maybe try to skip the rendering of the overlay if there is no mask and if we are only rendering the default face set (it is just using a white color, the face set is still there), but that sounds like a hack. Ideally, the state of the mask and the face sets should not affect performance at all, so fps should also not drop when the object is fully masked. Can we consider rendering everything in a single draw from workbench?

In #74692#895792, @brecht wrote:
Mask > Invert Mask causes a similar slowdown in Blender 2.82.

Yes it does.

> In #74692#895792, @brecht wrote: >Mask > Invert Mask causes a similar slowdown in Blender 2.82. Yes it does.

Testing Sculpting template

2.82:
No mask: 350 FPS
All masked: 335 FPS

blender-2.83-c26f470cfeea-windows64
No mask: 287 FPS
All masked: 280 FPS

a696053545
No mask: 220 FPS
All masked: 230 FPS


Sculpting template with multires, 4x subdivide

2.82:
No mask: 61 FPS
All masked: 33 FPS

blender-2.83-c26f470cfeea-windows64
No mask: 58 FPS
All masked: 30 FPS

a696053545
No mask: 30 FPS
All masked: 30 FPS

Testing Sculpting template 2.82: No mask: 350 FPS All masked: 335 FPS blender-2.83-c26f470cfeea-windows64 No mask: 287 FPS All masked: 280 FPS a696053545e9 No mask: 220 FPS All masked: 230 FPS ----- Sculpting template with multires, 4x subdivide 2.82: No mask: 61 FPS All masked: 33 FPS blender-2.83-c26f470cfeea-windows64 No mask: 58 FPS All masked: 30 FPS a696053545e9 No mask: 30 FPS All masked: 30 FPS

Added subscribers: @fclem, @Jeroen-Bakker

Added subscribers: @fclem, @Jeroen-Bakker

We could maybe try to skip the rendering of the overlay if there is no mask and if we are only rendering the default face set (it is just using a white color, the face set is still there), but that sounds like a hack.

It's not a hack, it's good to design to skip drawing things you don't need. Even if drawing can be optimized, we don't want every new feature to add a small performance cost because it all accumulates.

Can we consider rendering everything in a single draw from workbench?

This would be a question for @Jeroen-Bakker or @fclem.

> We could maybe try to skip the rendering of the overlay if there is no mask and if we are only rendering the default face set (it is just using a white color, the face set is still there), but that sounds like a hack. It's not a hack, it's good to design to skip drawing things you don't need. Even if drawing can be optimized, we don't want every new feature to add a small performance cost because it all accumulates. > Can we consider rendering everything in a single draw from workbench? This would be a question for @Jeroen-Bakker or @fclem.

Not that even if this would be part of Workbench, it probably would still be an overlay for Eevee. I think it's worth ensure that if either no mask or face sets are used, or the options are off in the overlay popover, that no unnecessary drawing happens.

Not that even if this would be part of Workbench, it probably would still be an overlay for Eevee. I think it's worth ensure that if either no mask or face sets are used, or the options are off in the overlay popover, that no unnecessary drawing happens.

This issue was referenced by 32bb848838

This issue was referenced by 32bb8488389ae8dc9abd8ae5f662ce4a7f16f104
Author

@PabloDobarro In that fix D7207 you said:

This will still slow down the viewport when a new face set is created

So after the face set is create and everything is slow, will we be able to make it fast again? Disabling it in the overlays will do that?

@PabloDobarro In that fix [D7207](https://archive.blender.org/developer/D7207) you said: ``` This will still slow down the viewport when a new face set is created ``` So after the face set is create and everything is slow, will we be able to make it fast again? Disabling it in the overlays will do that?

Added subscriber: @Frozen_Death_Knight

Added subscriber: @Frozen_Death_Knight

Can confirm as well that Sculpt Mode is laggier since a few weeks ago. Noticed camera lag already around 700-800k vertices. Before I could reach at least a few million without noticing any major performance hiccups. MultiRes without Optimal Display on is less laggy than sculpting on a voxel remeshed model of some reason.

Can confirm as well that Sculpt Mode is laggier since a few weeks ago. Noticed camera lag already around 700-800k vertices. Before I could reach at least a few million without noticing any major performance hiccups. MultiRes without Optimal Display on is less laggy than sculpting on a voxel remeshed model of some reason.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Pablo Dobarro self-assigned this 2020-03-26 15:40:34 +01:00
Author

Hi guys. I'm afraid this issue is not totally solved. There's still a significant lag difference, if you compare it to for example 2.82.
Maybe this could be marked as known issue/limitation?

Hi guys. I'm afraid this issue is not totally solved. There's still a significant lag difference, if you compare it to for example 2.82. Maybe this could be marked as known issue/limitation?

@NelsonNAS please create new report and provide a test case to compare performance

@NelsonNAS please create new report and provide a test case to compare performance
Sign in to join this conversation.
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
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#74692
No description provided.