Skip to content

Replace THREE.Clock with THREE.Timer#378

Merged
dmarcos merged 1 commit into
sparkjsdev:mainfrom
mrxz:three-clock
Jul 15, 2026
Merged

Replace THREE.Clock with THREE.Timer#378
dmarcos merged 1 commit into
sparkjsdev:mainfrom
mrxz:three-clock

Conversation

@mrxz

@mrxz mrxz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

When using Spark with Three.js r183 or later a warning will be logged in the dev console that the THREE.Clock class has been deprecated. This PR replaces it with THREE.Timer which is already available in core Three.js since r179, so should be usable in the entire supported version range of Spark (>= r180).

The cloning is no longer needed as querying the elapsed time and/or delta time no longer updates the internal state. This also means that it can now properly be used for effect synchronization. Although in the various examples of Spark a custom time uniform seems to be consistently used making me wonder if the built-in approach should be better documented or alternatively scrapped entirely.

@dmarcos
dmarcos merged commit 8024e57 into sparkjsdev:main Jul 15, 2026
2 checks passed
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