Page MenuHome

Performance: 2D painting performance.
AbandonedPublicDraft

Authored by Jeroen Bakker (jbakker) on Nov 12 2021, 12:58 PM.
Tokens
"Love" token, awarded by Yuro."Love" token, awarded by kursadk."Love" token, awarded by Schiette."Love" token, awarded by RedMser.

Details

Summary

When painting a mask is generated that only changes when some parameters
changes. Currently this mask was recreated every time the cache was
updated. This patch checks if the mask should be regenerated based on selected settings:

  • Radius
  • Number of used aa samples
  • Brush curve and preset.

Found when doing some performance analysis.

Still WIP as the offsets are currently ignored. But the patch shows that there is potential to improve the performance.
To reduce memory needs we could store the offset differences as deltas and limit the number of offsets with a bit mask (5x5).

Diff Detail

Repository
rB Blender
Branch
temp-2d-painting-performance (branched from master)
Build Status
Buildable 18620
Build 18620: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Nov 12 2021, 1:11 PM
  • Added a hasher to detect if the mask should be regenerated.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Nov 12 2021, 2:08 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Nov 12 2021, 4:15 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Nov 12 2021, 7:16 PM

Added a better solution already available in master. Note that there are still a lot of areas where the performance of painting could be improved.

  • Adaptive sampling of the curve_mask based on the volatility of the curve in areas.
  • Don't do FSAA for anti aliasing.