fix(gsplat): apply lodRangeMin/lodRangeMax from component init data#8968
Merged
Conversation
lodRangeMin and lodRangeMax were added to GSplatComponent in #8908 but never added to the component system's _properties list. As a result they were silently ignored when passed to addComponent() and dropped when a gsplat component was cloned (reset to their defaults of 0 / 99). Add them alongside the sibling lodBaseDistance/lodMultiplier properties. Also adds a GSplatComponent test covering init-from-data and clone, and simplifies the splat-portal and world examples to pass their static LOD values directly to addComponent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Build size reportThis PR changes the size of the minified bundles.
|
mvaligursky
approved these changes
Jun 26, 2026
willeastcott
added a commit
that referenced
this pull request
Jun 26, 2026
…8968) lodRangeMin and lodRangeMax were added to GSplatComponent in #8908 but never added to the component system's _properties list. As a result they were silently ignored when passed to addComponent() and dropped when a gsplat component was cloned (reset to their defaults of 0 / 99). Add them alongside the sibling lodBaseDistance/lodMultiplier properties. Also adds a GSplatComponent test covering init-from-data and clone, and simplifies the splat-portal and world examples to pass their static LOD values directly to addComponent. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
willeastcott
added a commit
to playcanvas/web-components
that referenced
this pull request
Jun 26, 2026
playcanvas/engine#8968 (merged) adds lodRangeMin/lodRangeMax to the gsplat component system's _properties list, fixing the root cause at the engine level. Note this in the comment so the initComponent() override can be removed once web-components' minimum supported engine version includes the fix. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
willeastcott
added a commit
to playcanvas/web-components
that referenced
this pull request
Jun 29, 2026
lodRangeMin/lodRangeMax were first added to GSplatComponent in engine 2.20.0, so versions earlier than 2.20.0 do not have them at all. The gsplat system _properties allow-list omitted them only in 2.20.0; the fix (playcanvas/engine#8968) shipped in 2.20.1. Reword the comment so it no longer implies "2.20.0 and earlier" are affected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
willeastcott
added a commit
to playcanvas/web-components
that referenced
this pull request
Jun 29, 2026
Engine 2.20.1 (playcanvas/engine#8968) adds lodRangeMin/lodRangeMax to the gsplat component system's _properties allow-list, so they now apply correctly via getInitialComponentData() like the other attributes. Move them there and remove the initComponent() override. Bump the playcanvas peer dependency to ^2.20.1 so consumers can't land on 2.20.0, where these props exist on the component but are dropped from initialization data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
willeastcott
added a commit
to playcanvas/web-components
that referenced
this pull request
Jun 29, 2026
* Expose lod-range-min and lod-range-max attributes on pc-gsplat Add lodRangeMin/lodRangeMax to the pc-gsplat element, completing the LOD control surface alongside the existing lod-base-distance/lod-multiplier. These clamp the LOD index selected by distance (min = finest allowed, max = coarsest allowed); raising the min avoids downloading the largest, highest-quality LOD files. The engine's GSplatComponentSystem.initializeComponentData only applies a fixed allow-list of properties and ignores lodRangeMin/lodRangeMax, so the values are applied through the initComponent() hook after the component exists rather than via getInitialComponentData(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Reference upstream engine fix in initComponent workaround comment playcanvas/engine#8968 (merged) adds lodRangeMin/lodRangeMax to the gsplat component system's _properties list, fixing the root cause at the engine level. Note this in the comment so the initComponent() override can be removed once web-components' minimum supported engine version includes the fix. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Correct initComponent comment: only engine 2.20.0 is affected lodRangeMin/lodRangeMax were first added to GSplatComponent in engine 2.20.0, so versions earlier than 2.20.0 do not have them at all. The gsplat system _properties allow-list omitted them only in 2.20.0; the fix (playcanvas/engine#8968) shipped in 2.20.1. Reword the comment so it no longer implies "2.20.0 and earlier" are affected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Drop initComponent workaround for lodRangeMin/lodRangeMax Engine 2.20.1 (playcanvas/engine#8968) adds lodRangeMin/lodRangeMax to the gsplat component system's _properties allow-list, so they now apply correctly via getInitialComponentData() like the other attributes. Move them there and remove the initComponent() override. Bump the playcanvas peer dependency to ^2.20.1 so consumers can't land on 2.20.0, where these props exist on the component but are dropped from initialization data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Description
lodRangeMinandlodRangeMaxwere added toGSplatComponentin #8908, but were never added to the gsplat component system's_propertieslist. As a result they were:addComponent('gsplat', { lodRangeMin, lodRangeMax }), andcloneComponentcopies state via the same_propertieslist, so duplicating/templating/entity.clone()-ing a gsplat entity reset both properties back to their defaults (0/99).This adds them to
_properties, next to the siblinglodBaseDistance/lodMultiplierprops that were already there. The component setters already exist and propagate to theGSplatPlacement, so no other engine change is needed.Also included
test/framework/components/gsplat/component.test.mjscovering defaults, init-from-data, setter clamps, and clone preservation (there was no gsplat component test before). I confirmed the init/clone cases fail without the_propertieschange.splat-portalandworldnow pass their static LOD values directly toaddComponentrather than assigning them immediately afterwards. This is behavior-preserving — init data is applied beforeasset, so_onGSplatAssetLoadcopies the identical values onto the placement. The other gsplat LOD examples (lod-streaming,lod-streaming-sh,relighting,vr-lod,downtown,depth-of-field,billions) set these dynamically via preset/toggle handlers or from the loaded asset's LOD count, so they're intentionally left as-is.Checklist