Commit graph

30 commits

Author SHA1 Message Date
Dennis Kobert
1020eb6835 Implement the Brush without relying on a stamp texture
Test Plan: Test the BrushNode in the editor

Reviewers: Keavon

Reviewed By: Keavon

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1184
2023-04-29 01:31:14 +02:00
Dennis Kobert
bdc1ef926a Restructure GPU execution to model GPU pipelines in the node graph (#1088)
* Start implementing GpuExecutor for wgpu

* Implement read_output_buffer function

* Implement extraction node in the compiler

* Generate type annotations during shader compilation

* Start adding node wrapprs for graph execution api

* Wrap more of the api in nodes

* Restructure Pipeline to accept arbitrary shader inputs

* Adapt nodes to new trait definitions

* Start implementing gpu-compiler trait

* Adapt shader generation

* Hardstuck on pointer casts

* Pass nodes as references in gpu code to avoid zsts

* Update gcore to compile on the gpu

* Fix color doc tests

* Impl Node for node refs
2023-04-23 10:18:31 +02:00
Dennis Kobert
76c754d38a Simplify node trait definition (#1146)
* Simplify node trait
2023-04-17 23:42:22 +02:00
Dennis Kobert
589ff9a2d3 Implement the Brush tool (#1099)
* Implement Brush Node

* Add color Input

* Add VectorPointsNode

* Add Erase Node

* Adapt compilation infrastructure to allow non Image Frame inputs

* Remove debug output from TransformNode

* Fix transform calculation

* Fix Blending by making the brush texture use associated alpha

* Code improvements and UX polish

* Rename Opacity to Flow

* Add erase option to brush node + fix freehand tool

* Fix crash

* Revert erase implementation

* Fix flattening id calculation

* Fix some transformation issues

* Fix changing the pivot location

* Fix vector data modify bounds

* Minor fn name cleanup

* Fix some tests

* Fix tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2023-04-11 10:35:21 +02:00
Dennis Kobert
7254c008f9 Introduce scopes (#1053)
* Implement let binding

* Add lambda inputs

* Fix tests

* Fix proto network formatting

* Generate a template Scoped network by default

* Add comment to explain the lambda parameter

* Move binding wrapping out of the template

* Fix errors cause by image frames
2023-03-02 17:13:28 +01:00
Dennis Kobert
3015a9c8af Chain cache node and Clone to make them usable from the ui (#1032)
Chain cache node and Clone to make it a drop in replacement
2023-02-16 15:03:13 +01:00
0HyperCube
1b0e1b9bdf Update Imaginate to output bitmap data to the graph via Image Frame node (#1001)
* Multiple node outputs

* Add new nodes

* gcore use std by default to allow for testing

* Allow multiple node outputs

* Multiple outputs to frontend

* Add ImageFrameNode to node registry

* Minor cleanup

* Basic transform implementation

* Add some logging to image encoding

* Fix ImageFrameNode

* Add transform input to Imaginate node (#1014)

* Add transform input to imaginate node

* Force the resolution to be edited with no transform

* Add transform to imaginate generation

* Fix compilation

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add labels to node outputs

* Fix seed; disable mask when transform is disconnected; add Imaginate tooltips

* Rename 'Input Multiple' node to 'Input'

* Code review

* Replicate to Svelte

* Show only the primary input chain in the Properties panel

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-11 08:56:31 +00:00
Dennis Kobert
620540d7cd Incremental compilation and stable node IDs (#977)
* Generate stable node ids

* checkpoint

* Implement borrow tree

* Add eval function on borrow tree

* Refactor Node trait to fix lifetime issues

* Compiler infinite loop

* Impl compose pair

* Transition to double lifetime on trait

* Change node trait to use a generic arg for the input

* Start adapting node_macro

* Migrate more nodes to new macro

* Fix raster tests

* Port vector nodes

* Make Node trait object safe

* Fix FlatMapResultNode

* Translate most of gstd

* Fix DowncastBothNode

* Refactor node trait once again to allow for HRTB for type erased nodes

* Start working on type erased nodes

* Try getting DowncastBothNode to work

* Introduce Upcasting node + work on BorrowTree

* Make enough 'static to get the code to compile

* Transition DynamicExecutor to use borrow tree

* Make Compose Node use HRTB's

* Fix MapResultNode

* Disable blur test

* Add workaround for Composing type erased nodes

* Convert more nodes in the node_registry

* Convert more of the node_registry

* Add update tree fn and hook up to frontend

* Fix blur node

* Implement CacheNode

* Make frontend use graph compiler

* Fix document_node_types type declaration for most nodes

* Remove unused imports

* Move comment down

* Reuse nodes via borrow tree

* Deprecate trait based value in favor of TaggedValue

* Remove unsafe code in buffer creation

* Fix blur node

* Fix stable node id generation

* Fix types for Image adjustment document nodes

* Fix Imaginate Node

* Remove unused imports

* Remove log

* Fix off by one error

* Remove macro generated imaginate node entry

* Create parameterized add node

* Fix test case

* Remove link from layer_panel.rs

* Fix formatting
2023-02-07 20:06:24 +01:00
0HyperCube
2bcc3d3baf Improve history states (#932)
* Add some more history states

* Fix undo whilst drawing

* Paste image history

* Toggle output and preview history

* Code review nits

* Remove extra '{'

* Fix typo

* Fix about.toml

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-01 22:02:44 +00:00
Dennis Kobert
a9601ab164 Implement the Gaussian Blur node (#933) 2022-12-31 21:12:02 +01:00
TrueDoctor
57a1f653e1 Implement node graph gpu execution via vulkano and rust gpu (#870)
* Add Executor abstraction

* Resolve inputs for proto nodes by adding compose nodes

* Add infrastructure for compiling gpu code

* Integrate nodegraph gpu execution into graph-crafter

* Extract graphene core path from env vars

* Make Color struct usable for gpu code
2022-12-05 12:56:36 +01:00
TrueDoctor
4ec600957c Node graph dynamic execution (#824)
Restructure document node implementation

* Implement topological sort

* Enforce the usage of type annotations

* Add complete test case
2022-10-26 00:45:42 +02:00
TrueDoctor
11c6413251 Implement node registry (#822) 2022-10-26 00:32:50 +02:00
TrueDoctor
562217015d Rework DynAnyNode design to work with the borrow stack (#796) 2022-10-15 03:02:58 +02:00
0hypercube
cef58b16c2 Some initial testing on dynamic nodes and composition
* Test use of borrow stack
2022-09-28 18:47:34 +01:00
0HyperCube
f5e8c48dfb Use .then() instead of .after() for sequencing nodes (#760)
* Add .then() for sequencing nodes

* Remove all uses af after

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-08-28 20:52:46 +01:00
Dennis
71f12db1e6 Impl DynNode 2022-08-22 17:18:26 +02:00
Dennis
bdad7aca47 Make node trait consume self 2022-08-19 18:58:17 +02:00
Dennis
12b33da083 Implement image loding test 2022-08-13 19:15:48 +02:00
Dennis
8a0eb0e266 Add tests for op nodes 2022-08-13 18:21:46 +02:00
Dennis
b06e00ce61 Implement cons node 2022-08-13 14:54:12 +02:00
Dennis
d09f023618 Bump dyn-any version + format code 2022-08-04 09:08:48 +02:00
Dennis
e84b9bd5bd Compile node graph description to GPU code 2022-06-08 09:52:58 +02:00
Dennis
998f37d1b0 Add Unit and Id nodes to node graph 2022-06-05 22:58:12 +02:00
Dennis
a2703c0fb1 Don't force nodes to store references to other nodes 2022-06-05 15:25:07 +02:00
Dennis
fa5345d33f Remove input from the node definition 2022-06-05 01:15:22 +02:00
Dennis
f6e4dbf3e3 Add GPU support for node graph 2022-04-24 11:58:31 +02:00
Dennis
09deee0c4d Make graphene_core no_std 2022-04-22 15:15:39 +02:00
Dennis
cb337fd338 Replace GAT with lifetime on trait in node graph 2022-04-03 10:44:02 +02:00
Dennis
3243b80cf2 Try and fail to make nodes object-safe in node graph 2022-04-02 20:50:53 +02:00
Renamed from node-graph/gstd/src/ops.rs (Browse further)