Struct of Arrays Refactor for Mesh Polygons #95967
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#95967
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?
Currently,
MPoly
stores some unnecessary data besides what is necessary:Data Format
For the reasons described in #95965, this is an inefficient way to organize data.
The first goal is to move the everything besides the face corner start index and the size to separate data layers.
Next, we can use the same offsets storage as curves to transform
MPoly
into a single integer indicatingthe offset of the first corner in the face corner domain. The size of the polygon would be the difference
between that integer offset and the next.
Array<int> poly_offsets
This pattern is abstracted with the
OffsetIndices
class in Blender. The data would be accessed in two ways:Iterating over the corners of a face is quite simple.
The only functional change this requires is that the order of the corners in a mesh is consistent with
the order of the corresponding polygons. Since this is the case in (all?) cases where new meshes are
created, it should be okay to expect this and to version meshes that don't comply.
The final result is that accessing mesh polygons will require a third of the memory that it does now.
Since they are used in hot loops where other data is accessed, that should give a sizeable improvement.
Material Index
This should move to a named integer attribute, with the name
material_index
.This means it doesn't have to be processed when there are no material indices,
and meshes with a single material can also be processed more efficiently.
f1c0249f34
Flag
In the flag is:
Selection
12becbf0df
This can be moved to a boolean custom data layer. Some way to process it differently than regular attributes will have to be implemented.
ME_SMOOTH
#93551 proposed moving this data completely to the edge domain, but in the end it is simpler to allow it to be on both edges and faces.
The flag value will be moved to a
sharp_face
attribute.ME_HIDE
2480b55f21
This can be moved to a separate boolean custom data layer, likely with a reserved name.
This issue was referenced by
2480b55f21
This issue was referenced by
f1c0249f34
This issue was referenced by
12becbf0df