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

TSL: Introduce time #29557

Merged
merged 5 commits into from
Oct 5, 2024
Merged

TSL: Introduce time #29557

merged 5 commits into from
Oct 5, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Oct 5, 2024

Description

timerLocal(), timerGlobal() and timerDelta() the differences are often confusing to the user and not everyone ends up using the scale argument present in the function. This was replaced by time and deltaTime, which are the most common variable present in various projects. The class name was changed to Timer. In addition to the better design, the uniform is updated once per frame, which should result in better performance.

The oscillators were also simplified.

@sunag sunag added this to the r170 milestone Oct 5, 2024
Copy link

github-actions bot commented Oct 5, 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 808.38
217.75
807.6
217.49
-786 B
-263 B
WebGPU Nodes 807.89
217.62
807.11
217.36
-786 B
-262 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.6
144.85
535.38
144.47
-1.22 kB
-371 B
WebGPU Nodes 492.71
134.59
491.49
134.28
-1.22 kB
-300 B

@sunag sunag marked this pull request as ready for review October 5, 2024 06:37
@sunag sunag merged commit 25e6fd3 into mrdoob:dev Oct 5, 2024
12 checks passed
@sunag sunag deleted the dev-timer branch October 5, 2024 16:52
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.

1 participant