Sculpt geometry representation design #85296
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85296
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
This task goal is to discuss the requirements and design a new mesh representation structure to replace both ##Mesh## and grids in Sculpt Mode, trying to improve performances, memory usage and tool compatibility.
Requirements
Tools
Main topology queries
Almost all tools and functionality in sculpt mode relies on the following topology info:
Vertex to connected vertices: All cloth sculpting, boundary, pose, all smooth algorithms, data slide and flood fill operations rely on looping over neighbor vertices. This is the most performance-critical operation.
Vertex to faces that use that vertex: Used for all face set related functionality (mesh visibility state, face set boundaries, automasking, pose brush origin detection...)
On top of this, tools need to always know if a vertex is part of a mesh boundary. Right now, this is cached into a bitmap by looping over polys and edges of ##Mesh##. This info does not change during the sculpting session unless the geometry is modified.
Normal updates for deformation
Updating the normals is currently done in two loops. First normals are calculated per face and then accumulated into vertices using atomics. Then vertex normals are normalized in a second loop.
As a proposal, if the neighbors vertex list is stored in radial order, it is possible to approximate the normal in a single loop per vertex, without atomics and with a single square root operation. Storing the list in radial order will also help to simplify and implementing new tools.
Draw Face Sets / Face Set Gestures
Face to vertices that use that face: This is used in the Draw Face Sets brush to increase the precision of the falloff. As the main iterator loops over vertices, the shown topology queries are used to get the center of the affected faces and apply the brush falloff in that point instead of using the vertex directly. This also allows to paint individual faces with a Face Set
Expand / Face Set Grow / Shrink
Face to neighbor faces by and edge and neighbor faces by a vertex: This is used to grow/shrink face sets IDs and create different patterns in Expand. It is also used to delete Face sets from the mesh with content-aware filling.
Face Sets Init
Face to neighbor faces with reference to edge: This is used to create Face Sets by UV seams or crease data. The reference to the edge is needed to check different flags and limit the flood fill operation which works using faces and faces neighbors. This is currently implemented using ##BMesh##
Mesh Fairing
Fairing supports multiple algorithms to calculate vertex and loop weights to achieve different effects. The only one of those algorithms that is currently being used for the sculpt mode tools is Voronoi vertex weights.
When using ##Mesh##, this algorithm is using a vertex to loop map. From that loop, it needs the next and previous vertex to make a triangle. If neighbors are stored in radial order, this should be possible to implement using only that information.
Even if fairing uses loop weights, both fairing operations that are required for sculpt mode use uniform loop weights (all loops have the weight of 1), so face corner references are not needed.
Geodesic Distances
Geodesic distances is used for surface falloff and expand. The current geodesic distances algorithm needs two extra maps on top of #Mesh# to implement the following queries:
Edge to neighbor vertices connected by a face: Currently implemented by using and edge to poly map and then looping overt the loops of that poly.
Vertex to edges that use that vertex: Currently implemented with a vertex -> edge map
Geodesic distances requires references to the geometry edges.
Rendering
BVH building and ray intersections
Both are done using a separate array to store the triangles. In Multires, they use the grids directly.
Mesh / BMesh conversions
I am removing the
Needs Triage
label. This is under the general rule that Design and TODO tasks should not have a status.If you believe this task is no longer relevant, feel free to close it.