Skip to content

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Nov 23, 2024

Related issue: #29644 (comment)

Description

  • Introduce three/tsl build to import maps. The new file is three.tsl.js. ( TSL )
  • Introduce three/webgpu to import maps. ( Core + WebGPURenderer + Nodes )
  • Update all examples and depedencies.

Example

import { RenderTarget, Texture, Vector2, QuadMesh, NodeMaterial, TempNode } from 'three/webgpu';

import { If, Loop, int, Break, sqrt, sign, mix } from 'three/tsl';

@mrdoob I think both unnoticed already have a TSL.js file in the lib, what do you think if we follow the second option Three.TSL.js for the build?

@sunag sunag added this to the r171 milestone Nov 23, 2024
Copy link

github-actions bot commented Nov 23, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.13
79
339.13
79
+0 B
+0 B
WebGPU 483.69
134.01
481.83
133.9
-1.86 kB
-111 B
WebGPU Nodes 483.16
133.9
481.3
133.8
-1.86 kB
-105 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 464.59
111.96
464.59
111.96
+0 B
+0 B
WebGPU 550.99
149.23
550.99
149.23
+0 B
+0 B
WebGPU Nodes 506.87
138.94
506.87
138.94
+0 B
+0 B

@sunag sunag marked this pull request as ready for review November 24, 2024 17:53
@sunag sunag merged commit 84ab41c into mrdoob:dev Nov 24, 2024
12 checks passed
@sunag sunag deleted the dev-build-tsl branch November 24, 2024 19:41
@mrdoob
Copy link
Owner

mrdoob commented Nov 29, 2024

Before After Diff
WebGL 339.13
79
339.13
79
+0 B
+0 B
WebGPU 483.69
134.01
481.83
133.9
-1.86 kB
-111 B
WebGPU Nodes 483.16
133.9
481.3
133.8
-1.86 kB
-105 B

I was thinking the WebGPU builds would get smaller when moving the TSL out of it?

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