PBVH_BMESH Notes #87456
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
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#87456
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?
Lately there's been interest in users (and some developers) in adding more topological workflows to sculptmode and/or refactoring editmode to use PBVH_BMESH. This will require much refactoring of the code, some of which has already happened as part of the DynTopo cleanup project (but not everything).
The purpose of this document is to set down some ideas for the future direction of PBVH_BMESH and how we might get there.
Current state of PBVH_BMESH
PBVH_BMESH Changes
Customdata interpolation is now supported for DynTopo.
PBVH drawing now sets GPU attributes (mostly) correctly (still need to support multiple UV layers properly).
Vertices now have a special MDynTopoVert customdata structure for storing original data.
PBVHNode->bm_unique_verts/bm_other_verts/bm_faces now use a special GSET wrapper that caches entries in a flat array for fast iteration.
Original data is no longer tied to the undo system (at all) for PBVH_BMESH.
Triangles are no longer cached in an ad-hoc way in node->bm_ortri and bm_orco.
PBVH nodes are now joined together at the end of a stroke if they lose too much topology during dyntopo. This
There is an option to draw sculpt colors in flat cells instead of the usual vcol interpolation.
General PBVH Changes
The sculpt API now has a concept of sculpt vertex references (SculptVertRef) which are indices for PBVH_FACES/GRIDS and BMVert pointers for
PBVH_BMESH. You can convert between sculpt vert refs and mesh indices with BKE_vertex_index_to_table and BKE_table_index_to_vertex.
To prevent implicit casts to/from 32-bit ints, SculptVertRef is a structure:
The same idea is used for face references too with a similar SculptFaceRef structure.
Storing Triangulations In Nodes
We should cache triangles in PBVH nodes. I've roughed out a simple api for this in temp_multires_bmesh already (there were a few truly evil bugs that necessitated it). The new data structures are below.
I've kept things as simple as possible (I was planning on doing this a lot later). Triangulations are generated lazily as with the old bm_ortri code, only instead
of flagging nodes as dirty by freeing the triangulation a new PBVH_UpdateTris flag is set in node->flag.
Some open questions are:
Should we use this for all PBVH types? If so, what should the related SCULPT_XXX api look like?
Future Steps
To make PBVH_BMESH usable outside of DynTopo (and even sculpt), the following needs to happen:
Add support for fragment shader based flat face shading to the draw system.
Added subscriber: @JosephEagar
Added subscriber: @IyadAhmed
Added subscriber: @MetinSeven-1
Added subscriber: @PabloDobarro
Added subscriber: @GeorgiaPacific
Added subscriber: @StephenSwaney
Added subscriber: @PratikPB2123
Added subscriber: @Alchimista
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.