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

NodeMaterial: Introduce .geometryNode and jelly example #29551

Merged
merged 5 commits into from
Oct 5, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Oct 4, 2024

Related issue: #29547

Description

The goal is to have a dedicated API for dealing with geometry, whether during a single frame or the every frame that the object is rendered. This also simplifies the integration of modifications with new objects since all the user needs to define is typically material.geometryNode = myGeometryNode() like the example bellow.

// With the 'material.geometryNode' there is no need to worry about the 'renderer.compute( node )'.

const material = new THREE.MeshNormalNodeMaterial();
material.geometryNode = jelly();

@sunag sunag changed the title NodeMaterial: Introduce .geometryNode NodeMaterial: Introduce .geometryNode and jelly example Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 688.13
170.5
688.13
170.5
+0 B
+0 B
WebGPU 807.88
217.63
808.1
217.67
+213 B
+38 B
WebGPU Nodes 807.39
217.49
807.61
217.53
+213 B
+38 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 462.85
111.78
462.85
111.78
+0 B
+0 B
WebGPU 536.32
144.76
536.53
144.8
+213 B
+40 B
WebGPU Nodes 492.4
134.49
492.61
134.53
+213 B
+42 B

@sunag sunag added this to the r170 milestone Oct 4, 2024
@sunag sunag marked this pull request as ready for review October 4, 2024 23:42
@sunag sunag merged commit 5f96ed4 into mrdoob:dev Oct 5, 2024
12 checks passed
@sunag sunag deleted the dev-geometry-node branch October 5, 2024 00:37
@mrdoob
Copy link
Owner

mrdoob commented Oct 10, 2024

FYI @boytchev

@boytchev
Copy link
Contributor

Thanks for the head-up. This looks very promising for the type of things that I use TSL for. I still had to fully understand the jelly example in webgpu_compute_geometry.html. I have some why-questions, but I will first try to answer them by myself. And ... I feel sorry for Lee Perry Smith - his head appears to be the most tortured model in the world.

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.

3 participants