Fix ref counting and originToWorld in SparkViewpoint.prepare#207
Merged
dmarcos merged 1 commit intosparkjsdev:mainfrom Oct 29, 2025
Merged
Fix ref counting and originToWorld in SparkViewpoint.prepare#207dmarcos merged 1 commit intosparkjsdev:mainfrom
SparkViewpoint.prepare#207dmarcos merged 1 commit intosparkjsdev:mainfrom
Conversation
Contributor
|
Thank you! |
asundqui
added a commit
that referenced
this pull request
Apr 9, 2026
- 296eaee: Copy originToWorld values instead of holding a reference in SplatAccumulator (#191) - 1ecabe0: Interactive ripples effect (#194) - 589b6bc: Fix build_rust_wasm.sh script (correct shebang, don't require rustup) (#197) - 018a3ed: (already merged) Support logarithmic depth buffer (#199) - 8f90fe0: Fix reference counting for SplatAccumulator during updates (#200) - 18a33cb: portal effect (#203) - ad3a9bd: Fix ref counting and originToWorld in SparkViewpoint.prepare (#207) - 0d9f7bf: fix twister & rain effects (#211) - c9c488c: add greyscale painting and add i/o (#217) - 937262b: Interactive deform effect with bounce (#223) - 196721e: Add Demo Splat Dissolve Effects (#218) - 752cfaa: fix: resolve webpack/Next.js WASM data URL compatibility issue (#95) (#231) - 558a9a9: refactor: use magic-string for proper source maps in WASM fix (#234) - 237b181: Rename single character variable - fa71609: Add three as peerdependency (fix #238) - d6d5e7e: Ensure splatDefines ShaderChunk is ready when using Readback before SparkRenderer (#240) - 10a7541: add undo brush to splat painter example (#241) - a573987: Dispose of spherical harmonics arrays and packedArray in PackedSplats (#239) - dec8c4e: Add reference to Spark 2.0 preview in README - 1a8239b: Add Spark 2.0 example links to README
dmarcos
pushed a commit
that referenced
this pull request
Apr 14, 2026
- 296eaee: Copy originToWorld values instead of holding a reference in SplatAccumulator (#191) - 1ecabe0: Interactive ripples effect (#194) - 589b6bc: Fix build_rust_wasm.sh script (correct shebang, don't require rustup) (#197) - 018a3ed: (already merged) Support logarithmic depth buffer (#199) - 8f90fe0: Fix reference counting for SplatAccumulator during updates (#200) - 18a33cb: portal effect (#203) - ad3a9bd: Fix ref counting and originToWorld in SparkViewpoint.prepare (#207) - 0d9f7bf: fix twister & rain effects (#211) - c9c488c: add greyscale painting and add i/o (#217) - 937262b: Interactive deform effect with bounce (#223) - 196721e: Add Demo Splat Dissolve Effects (#218) - 752cfaa: fix: resolve webpack/Next.js WASM data URL compatibility issue (#95) (#231) - 558a9a9: refactor: use magic-string for proper source maps in WASM fix (#234) - 237b181: Rename single character variable - fa71609: Add three as peerdependency (fix #238) - d6d5e7e: Ensure splatDefines ShaderChunk is ready when using Readback before SparkRenderer (#240) - 10a7541: add undo brush to splat painter example (#241) - a573987: Dispose of spherical harmonics arrays and packedArray in PackedSplats (#239) - dec8c4e: Add reference to Spark 2.0 preview in README - 1a8239b: Add Spark 2.0 example links to README
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #205
The
preparemethod ofSparkViewpointincreased therefCountof the active accumulator in case it wasn't used in the viewpoint's display state. However the display reference is already covered, resulting in double counting this reference. At the same time there's no guarantee the viewpoint holds any reference whensortUpdateis called. To resolve this a temporary reference is held.Additionally there was a bug where the
preparemethod would default to not providing anoriginToWorldmatrix. This causes theSparkRendererto use the currenttoWorldof the active accumulator. This works as long as theSparkRendererhasn't been moved, but renders incorrectly in case it did. See following scenario:One thing that remains tricky with regards to
prepareis that it directly callssortUpdate, ignoring any ongoing sort operation or pending sort operation. This makes it possible forsortUpdateto throw an error, breaking the ref counting.