Mesh: Set bounds eagerly for cube and grid primitive nodes #105266

Merged
Hans Goudey merged 3 commits from HooglyBoogly/blender:mesh-bounds-set-eager into main 2023-03-09 18:12:05 +01:00
Member

For mesh primitives, the bounds can be calculated trivially in advance
with negligible cost. In case they are needed later on, setting them
eagerly can save the calculation later on. For large meshes, this can
save tens of milliseconds before drawing.

For mesh primitives, the bounds can be calculated trivially in advance with negligible cost. In case they are needed later on, setting them eagerly can save the calculation later on. For large meshes, this can save tens of milliseconds before drawing.
Hans Goudey added the
Interest
Geometry Nodes
Interest
Performance
labels 2023-02-27 20:04:32 +01:00
Hans Goudey added 1 commit 2023-02-27 20:04:50 +01:00
03b229dad9 Mesh: Set bounds eagerly for mesh primitive nodes
For mesh primitives, the bounds can be calculated trivially in advance
with negligible cost. In case they are needed later on, setting them
eagerly can save the calculation later on. For large meshes, this can
save tens of milliseconds before drawing.
Hans Goudey added this to the Nodes & Physics project 2023-02-27 20:05:07 +01:00
Hans Goudey requested review from Jacques Lucke 2023-02-27 20:05:21 +01:00

Is the Transform Geometry node suitable for this, or can it be later?

Is the Transform Geometry node suitable for this, or can it be later?
Author
Member

Is the Transform Geometry node suitable for this, or can it be later?

Yeah, that's a next step-- translate and transform the bounds eagerly when it's simple and they're already calculated.

> Is the Transform Geometry node suitable for this, or can it be later? Yeah, that's a next step-- translate and transform the bounds eagerly when it's simple and they're already calculated.
Jacques Lucke requested changes 2023-02-27 20:55:08 +01:00
@ -169,6 +169,9 @@ static Mesh *create_circle_mesh(const float radius,
}
}
const float3 bounds(radius, radius, 0.0f);
Member

I didn't check in detail yet, but this does not feel correct. It would only be correct if there was an infinite amount of vertices. The same likely applies to other primitives. It should still be possible to compute the bounding box efficiently in these cases, but it's not that trivial.

I didn't check in detail yet, but this does not feel correct. It would only be correct if there was an infinite amount of vertices. The same likely applies to other primitives. It should still be possible to compute the bounding box efficiently in these cases, but it's not that trivial.
Author
Member

Ah shoot, of course! Thanks for thinking of that.

Ah shoot, of course! Thanks for thinking of that.

Unified it could be represented as a cloud of several points. Their constant number for each primitive.
When the primitive is ready, the indexes of the primitive's points can be calculated based on primitive config, which can be bounding.

Unified it could be represented as a cloud of several points. Their constant number for each primitive. When the primitive is ready, the indexes of the primitive's points can be calculated based on primitive config, which can be bounding.
HooglyBoogly marked this conversation as resolved
Hans Goudey changed title from Mesh: Set bounds eagerly for mesh primitive nodes to WIP: Mesh: Set bounds eagerly for mesh primitive nodes 2023-02-27 21:27:48 +01:00
Hans Goudey added 2 commits 2023-03-07 21:30:11 +01:00
Hans Goudey changed title from WIP: Mesh: Set bounds eagerly for mesh primitive nodes to Mesh: Set bounds eagerly for mesh primitive nodes 2023-03-07 21:30:40 +01:00
Hans Goudey requested review from Jacques Lucke 2023-03-07 21:35:32 +01:00
Jacques Lucke approved these changes 2023-03-09 16:30:06 +01:00
Hans Goudey changed title from Mesh: Set bounds eagerly for mesh primitive nodes to Mesh: Set bounds eagerly for cube and grid primitive nodes 2023-03-09 18:10:42 +01:00
Hans Goudey merged commit f9c627b275 into main 2023-03-09 18:12:05 +01:00
Hans Goudey deleted branch mesh-bounds-set-eager 2023-03-09 18:12:05 +01:00
Sign in to join this conversation.
No reviewers
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 Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105266
No description provided.