Page MenuHome

[WIP] Sculpt: Optimize PBVH drawing and queries
Changes PlannedPublic

Authored by Pablo Dobarro (pablodp606) on Sun, Sep 27, 10:14 PM.
"Love" token, awarded by vladimirzb."100" token, awarded by Frozen_Death_Knight."Love" token, awarded by astrand130."100" token, awarded by Brandon777."100" token, awarded by Anubis.



This is Milestone 1 of T81180

This patch reduces the size of the PBVH leaf nodes and includes
all necessary optimizations to keep Sculpt Mode working when using
smaller leaf sizes, increasing performance.

Diff Detail

rB Blender
pbvh-drawing-queries (branched from master)
Build Status
Buildable 10426
Build 10426: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Sun, Sep 27, 10:14 PM
Pablo Dobarro (pablodp606) planned changes to this revision.
Pablo Dobarro (pablodp606) created this revision.
Pablo Dobarro (pablodp606) added inline comments.

@Sergey Sharybin (sergey) @Brecht Van Lommel (brecht) After reducing the size of the leaf nodes, updating the bounding boxes per brush step is the slowest part. Right now we are using a recursive function that traverses the entire tree, but I don't quite get the logic of BKE_pbvh_update_bounds.

If I'm undestanding how the tree works correctly, this should be the same as the recursive call in BKE_pbvh_update_bounds, but without traversing the entire tree, but for some reasons the raycasts start failing and some brush steps are projected to the back of the mesh when I update the bounding boxes this way. Am I missing something?

Pablo Dobarro (pablodp606) retitled this revision from Sculpt: Optimize PBVH drawing and queries to [WIP] Sculpt: Optimize PBVH drawing and queries.Mon, Sep 28, 12:02 AM

@Pablo Dobarro (pablodp606) I am testing this right now and the perfromacne boost on the clay strips brush is very noticable. On 1,5 million faces it still lags behind sometimes but not much.
When using an anchored brush stroke with a texture it actually is worse right now than it was before. I don't know what other optimisations this patch should include.

I dragged for about 2-3 seconds on both and on the new patch it was a slightly worse performance and about 45 seconds of freezing afterwards.

@Julien Kaspar (JulienKaspar) Nice. This is only for Clay Strips. If you want to try anchored strokes, you can try D8983 (there brushes like draw sharp or grab also work)

@Pablo Dobarro (pablodp606) can you please follow the patch submission guidelines, more specifically, Ingredients of a Patch.

Neither the design task nor this patch explains the architectural reconsideration done to the code, why there were done, how to use the new system.
Another thing the description is lacking is performance and memory analysis. How much faster the performance is, how much more memory is used.

We also discussed having automated performance tests for providing objective performance comparisons. Can you please give an update on that?