Add support for pixels in PBVH #96710
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#96710
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?
PBVH is an accelleration structure blender uses internally to speed up 3d painting operations.
At this moment it is extensively used by sculpt, vertex painting and weight painting.
For the 3d texturing brush we will be using the PBVH for texture painting.
Currently PBVH is organized to work on geometry (vertices, polygons and triangles).
For texture painting this should be extended to use pixels.
Next to
PBVH_Leaf
there will be an additional node type (PBVH_Pixels
)PBVH_Pixels
is always a subnode ofPBVH_Leaf
or the PBVH_Leaf node in case the leaf doesn't need to split.Rasterization process
The rasterization process will generate the PBVH_Pixels for a leaf node. In order to do so every polygon should be uniquely assigned to a leaf node.
Polygons are too complicated to be used directly we have to split the polygons into triangles.
The list of triangles can be stored inside the leaf node. The list of polygons aren't needed anymore.
Each triangle has:
Each triangle can be rasterized and each row of pixels can be stored in a structure containing
Data can be encoded to reduce memory needs.
Depending on the number of pixels the node will be split.
There are several ways when the pixels should be recalculated:
Pixels are ordered by UDIM tiles, image buffer y coordinate, image buffer x coordinate. The range of a pixels per UDIM tile are stored along side the pixels.
Rasterization
During the performed experiments we use a fairly simple rasterization process by finding the UV bounds of an triangle and calculate the barycentric coordinates per pixel inside the bounds.
Even for complex models and huge images this process is normally finished within 0.5 second. It could be that we want to change this algorithm to reduce hickups when nodes are initialized during a stroke.
Testing
For testing purposes an initial implementation of a texturing paint brush will be implemented. This will only be available via an experimental feature flag.
Compression
If needed the list of pixels can be compressed as they are always accessed sequential. We should only do this if there is actually a memory issue we want to solve. For compression
we can think of variable size delta compression. Due to the ordering the image positions could be stored into 4-8 bits for a lot of cases.
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @Jeroen-Bakker
This issue was referenced by
e96a809a68
Changed status from 'Confirmed' to: 'Resolved'