Sculpt Brush Refactor #118145
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118145
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Currently there are several design issues with sculpt code that make feature development and performance improvements too hard. Much of the code is written in a way that makes applying proven "modern" optimization concepts like data-oriented design too complicated or difficult.
On top of that, sculpt code often works, while things like semantic consistency and larger architectural challenges are still big issues.
The largest difficulty comes from the method of sharing code between sculpting implementations for the three different supported data structures: Mesh, BMesh, and multires grids. The current approach is to pass everything through the same code path using a large macro. At runtime, per vertex, the code switches based on the active data structure. Besides the obvious downsides of those constant checks embedded in hot loops, it poses a larger challenge by forcing code to be written for a single element (vertex) at a time. One of the simplest ways to improve performance is to process many elements together.
Design Changes
Here are the high level design goals of the brush refactor.
PBVH
, so it is only used as an acceleration structure for raycasting that splits up geometry into multiple pieces.SculptSession
. Instead access data as necessary during modal operations, and avoid redundant references in long term structs.PBVHNode
, separate node storage per PBVH type. Reduce per-node overhead to a minumum.Specific To Do
An incomplete list of to do items. Should be extended as necessary.
SculptBrushTestFn
to works on arraysIndexMask
to address PBVH nodes by indexBKE_pbvh_vertex_iter_begin
PBVHVertRef
SculptSession
PBVH
orig_vb
isSculptFakeNeighbors
) API with code specific to the pose brushThis redesign will bring a huge performance improvement by taking a more cache friendly data oriented design
"Use separate implementations of each brush per PBVH type. Code reuse should instead come from the use of common utilties, rather than systems that force different data through the same code path."
There's no need to make individual brush implementations per PBVH type. The vast majority of brushes should use the common utilities you mentioned. The draw brush is the easiest case, but you should be able to build a few utilities for clay brushes (which are all based on projecting vertices to a plane).
Forgot to reference this task in #127162 /
5e63435e74
. Just noting it here so we still consider it part of this project.