Matrix operations and sockets for geometry nodes #105408
No reviewers
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105408
Loading…
Reference in New Issue
No description provided.
Delete Branch "LukasTonne/blender:nodes-matrix-types"
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?
Support for matrix operations in geometry nodes (and function nodes generally)
The socket represents a 4x4 matrix as the only type. This is to simplify matrix operations for users. Supporting 2x2 and 3x3 matrix types could have better performance and require less memory, but would make conversions necessary and force users to pick the correct variant of node for the respective matrix type. Eventually this might be supported with a generic socket type.
I'm glad that finally there are steps to this!
A couple of things at a glance:
I would personally recommend against going this route and instead present the user with the abstract concept of a transform. Matrices are lossy and can be easily deformed in a way that causes bugs further down the line.
Storing the location, rotation (quaternion, similarly abstracted), and scale as well as order is plenty to define and carry a transform. Imo to an end user matrices should be only used as a baked representation of these transforms (or black boxed formulas such as perspective). My approach to using them is that if avoidable they should not be manually modified, inversed (if possible to avoid loss of precision in world space), or decomposed back into LRS transforms. Possibly never exposed at all to the end user.
@KenzieMac130 Matrices are a very important mathematical abstraction that will give you a lot of possibilities. The quality of data accuracy is more of a general issue. And it is a consequence of poor user experience. Even transformations won't save her.
For the average user of 3D software they will only ever use location, rotation, and scale. Decomposing is lossy with rotation and scale, therefore not ideal for storing those values to retrieve later. Shears and other non-afine transforms to be applied on vertices are likely to be done by the average user using vector math instead nowadays. Giving the user the ability to arbitrarily define matrices is a guaranteed way to get unsanitary data. From what I have seen plenty of other 3D packages and engines avoid exposing them directly to the user.
I'd love to join into the design discussion, but isn't a (not yet existing) design issue the right place for that? Or was this initial design already approved by the Nodes & Physics team?
@McSwiff No design, Lukas took up prototyping matrix nodes after chatting in geometry nodes channel in chat
@KenzieMac130 Matrix is a mathematical abstraction for describing any linear 3D transformation.
Okay then, so minor design discussions are allowed in PRs now?
Given that matrix math is already a very sharp tool with which you can easily cut yourself. I would advocate for a "Compose/Recompose Matrix" node as a mirror to the "Decompose Matrix".
I've used it in the past, knowing fully well the loss of precision that comes with it. But I'm at the end of my chain of calculations. I just needed a simple to express and easy to read way to take my transform matrix and set the rotation of it based on something I calculated.
Is that a strong enough reason?
Any movement on this? Apart from a Compose Matrix node and possibly adding local and world matrix outputs from the Object Info node, this feels done and would be incredibly useful.
This is being worked on in #116067, so I'll close this PR. The code still may end up being helpful though.
Pull request closed