GPv3: Render evaluated geometry #122985

Merged
Falk David merged 8 commits from casey-bianco-davis/blender:GPv3-Curve-Geometry-Overlay into main 2024-07-22 11:10:25 +02:00

This is for rendered geometry and does not apply for edit mode overlays.

Note: This is hard to test without #122966

This is for rendered geometry and does not apply for edit mode overlays. Note: This is hard to test without #122966
casey-bianco-davis added the
Interest
Grease Pencil
Module
Grease Pencil
labels 2024-06-10 07:25:13 +02:00
casey-bianco-davis added 2 commits 2024-06-10 07:25:25 +02:00
casey-bianco-davis added this to the Grease Pencil project 2024-06-10 07:25:32 +02:00
casey-bianco-davis requested review from Falk David 2024-06-10 07:26:13 +02:00
Contributor

Sorry if this is dumb question, but when recently Bezier drawing and editing was implemented for Curves type I thought it was for grease pencil too? Don't they share CurvesGeometry?

Sorry if this is dumb question, but when recently Bezier drawing and editing was implemented for Curves type I thought it was for grease pencil too? Don't they share CurvesGeometry?
Author
Member

Sorry if this is dumb question, but when recently Bezier drawing and editing was implemented for Curves type I thought it was for grease pencil too? Don't they share CurvesGeometry?

They do share CurvesGeometry but the evaluated geometry was not being sent to the GPU, nor the triangulation; that's what this PR does.

> Sorry if this is dumb question, but when recently Bezier drawing and editing was implemented for Curves type I thought it was for grease pencil too? Don't they share CurvesGeometry? They do share `CurvesGeometry` but the evaluated geometry was not being sent to the GPU, nor the triangulation; that's what this PR does.
casey-bianco-davis added 1 commit 2024-06-30 01:13:46 +02:00
Hans Goudey requested changes 2024-06-30 01:26:08 +02:00
@ -314,3 +314,3 @@
const bke::CurvesGeometry &curves = info.drawing.strokes();
const OffsetIndices<int> points_by_curve = curves.points_by_curve();
const OffsetIndices<int> eval_points_by_curve = curves.evaluated_points_by_curve();
Member

If there is no other variable called points_by_curve, no need to change the variable name here. Same with elsewhere.

If there is no other variable called `points_by_curve`, no need to change the variable name here. Same with elsewhere.
casey-bianco-davis marked this conversation as resolved
@ -580,2 +580,4 @@
}
template<typename T>
static Array<T> attribute_interpolate(const VArray<T> input, const bke::CurvesGeometry &curves)
Member

It's important to avoid allocating a separate array for points if there are only poly curves in the drawing.
For that I suggest passing the array as a reference argument and returning a VArray that either references the original or the newly allocated and filled array.

It's important to avoid allocating a separate array for points if there are only poly curves in the drawing. For that I suggest passing the array as a reference argument and returning a VArray that either references the original or the newly allocated and filled array.
casey-bianco-davis marked this conversation as resolved
Hans Goudey changed title from GPv3: Display bézier geometry. to GPv3: Display Bézier geometry 2024-06-30 01:26:21 +02:00
casey-bianco-davis added 2 commits 2024-06-30 02:15:46 +02:00
casey-bianco-davis requested review from Hans Goudey 2024-06-30 02:16:11 +02:00
Hans Goudey approved these changes 2024-06-30 02:36:21 +02:00
@ -629,3 +641,2 @@
if (visible_strokes.contains(curve_i)) {
tris_start_offsets[pos] = t_offset;
pos++;
tris_start_offsets[pos++] = t_offset;
Member

This change is unrelated, best to just leave it out. Personally I choose to increment variables on separate lines just so the order is more obvious at a glance.

This change is unrelated, best to just leave it out. Personally I choose to increment variables on separate lines just so the order is more obvious at a glance.
casey-bianco-davis marked this conversation as resolved
casey-bianco-davis added 1 commit 2024-06-30 02:38:51 +02:00
casey-bianco-davis added 2 commits 2024-07-09 06:06:40 +02:00
Fix: Crash with non-poly curves.
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
845183b4bf
Falk David approved these changes 2024-07-16 12:54:38 +02:00
Falk David left a comment
Member

Code looks good to me. Nice that this is such a small change.

I'm getting some memory leaks when I tried this out:

Blender quit
Error: Not freed memory blocks: 5, total unfreed memory 0.002663 MB
customData_resize len: 640 0x7fffa519aa38
CDMIntProperty len: 8 0x7fffc16869c0
make_implicit_sharing_info_for_layer len: 40 0x7fffc3906a90
customData_resize len: 640 0x7fff93af2e38
create_curves_transform_custom_data len: 1464 0x7fff87177c40

@casey-bianco-davis anything you wouldn't expect here?

Code looks good to me. Nice that this is such a small change. I'm getting some memory leaks when I tried this out: ``` Blender quit Error: Not freed memory blocks: 5, total unfreed memory 0.002663 MB customData_resize len: 640 0x7fffa519aa38 CDMIntProperty len: 8 0x7fffc16869c0 make_implicit_sharing_info_for_layer len: 40 0x7fffc3906a90 customData_resize len: 640 0x7fff93af2e38 create_curves_transform_custom_data len: 1464 0x7fff87177c40 ``` @casey-bianco-davis anything you wouldn't expect here?
Member

With this change, loading files from GPv2 that used curve editng with bezier curves look correct now :)

With this change, loading files from GPv2 that used curve editng with bezier curves look correct now :)
Author
Member

I'm getting some memory leaks when I tried this out:

I could not get memory errors to occur.
@filedescriptor The log you got appears to be mentioning code unrelated to this PR, but as I cannot replicate the error I am not sure.

> I'm getting some memory leaks when I tried this out: I could not get memory errors to occur. @filedescriptor The log you got appears to be mentioning code unrelated to this PR, but as I cannot replicate the error I am not sure.
Member

@blender-bot build

@blender-bot build
Falk David changed title from GPv3: Display Bézier geometry to GPv3: Render evaluated geometry 2024-07-22 10:56:52 +02:00
Falk David merged commit 73338c1553 into main 2024-07-22 11:10:25 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
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#122985
No description provided.