Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port webgpu_compute example to "native" Nodes #23931

Merged
merged 2 commits into from
Apr 23, 2022
Merged

Conversation

LeviPesin
Copy link
Contributor

Related issue: -

Description

This PR tries to port the example to the "native" Nodes system.

@LeviPesin LeviPesin marked this pull request as ready for review April 22, 2022 13:43
@sunag sunag added this to the r140 milestone Apr 23, 2022
@sunag sunag merged commit 9e85d0b into mrdoob:dev Apr 23, 2022
@sunag
Copy link
Collaborator

sunag commented Apr 23, 2022

Thanks!!

@LeviPesin
Copy link
Contributor Author

What I noticed from trying to port the example:

  1. I just noticed that const position = temp( vec3() ); assign( position, add( particle, velocity ) ).build( builder ); can be simplified to just const position = temp( add( particle, velocity ) ); position.build();. @sunag Can you please file another PR to simplify that?
  2. We need something for controlling the order-of-execution of nodes - I do not really like constantly writing .build( builder )...
  3. We need to completely rework the CondNode to allow not only things like vec3 a; if (b) { a = vec3(0); } else { a = vec3(1); }, but to have arbitrary code in the branches.

@LeviPesin LeviPesin deleted the patch-1 branch April 23, 2022 07:46
@sunag
Copy link
Collaborator

sunag commented Apr 23, 2022

@LeviPesin I have been thinking about it for days... Calling .build() to assign, is still an interim solution.
I want to add support to create block code on NodeBuilder and keep CondNode with a behavior like a ? b : c and add IfElseNode like:

IF (  someNode, () => {

} );
IF (  someNode, () => {

} ).ELSE_IF ( someNode, () => {

} ).ELSE( () => {

} );

I have two solution in my mind for these issues, but I prefer to test before, and it might take a while to get ready.

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* Port webgpu_compute example to native Nodes

* Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants