Apply gsplat scene settings in applySceneSettings#8909
Merged
Conversation
Add GSplatParams#applySettings(render) and invoke it from Scene#applySettings so serialized scene render settings (e.g. from the Editor) configure the gsplat parameters. Reads flat gsplat-prefixed keys for a selected set of serializable parameters.
Public API reportThis PR changes the public API surface (+2 / −2), per the docs' rules (@ignore / @Private / undocumented are excluded). Show API diff-AppBase.applySceneSettings(settings: { physics: { gravity: number[] }; render: { ambientBake: boolean; ambientBakeNumSamples: number; ambientBakeOcclusionBrightness: number; ambientBakeOcclusionContrast: number; ambientBakeSpherePart: number; ambientLuminance: number; clusteredLightingEnabled: boolean; exposure: number; fog: string; fog_color: number[]; fog_density: number; fog_end: number; fog_start: number; gamma_correction: number; global_ambient: number[]; lightingAreaLightsEnabled: boolean; lightingCells: number[]; lightingCookieAtlasResolution: number; lightingCookiesEnabled: boolean; lightingMaxLightsPerCell: number; lightingShadowAtlasResolution: number; lightingShadowsEnabled: boolean; lightingShadowType: number; lightmapFilterEnabled: boolean; lightmapFilterRange: number; lightmapFilterSmoothness: number; lightmapMaxResolution: number; lightmapMode: number; lightmapSizeMultiplier: number; skybox: number | null; skyboxIntensity: number; skyboxLuminance: number; skyboxMip: number; skyboxRotation: number[]; skyCenter: number[]; skyMeshPosition: number[]; skyMeshRotation: number[]; skyMeshScale: number[]; skyType: string; tonemapping: number } }): void
+AppBase.applySceneSettings(settings: { physics: { gravity: number[] }; render: { ambientBake: boolean; ambientBakeNumSamples: number; ambientBakeOcclusionBrightness: number; ambientBakeOcclusionContrast: number; ambientBakeSpherePart: number; ambientLuminance: number; clusteredLightingEnabled: boolean; exposure: number; fog: string; fog_color: number[]; fog_density: number; fog_end: number; fog_start: number; gamma_correction: number; global_ambient: number[]; gsplatAlphaClip: number; gsplatAlphaClipForward: number; gsplatAntiAlias: boolean; gsplatColorUpdateAngle: number; gsplatCooldownTicks: number; gsplatDataFormat: string; gsplatEnableIds: boolean; gsplatFoveationCenter: number; gsplatFoveationStrength: number; gsplatLodBehindPenalty: number; gsplatLodUnderfillLimit: number; gsplatLodUpdateAngle: number; gsplatLodUpdateDistance: number; gsplatMinContribution: number; gsplatMinPixelSize: number; gsplatRadialSorting: boolean; gsplatSplatBudget: number; gsplatUseFog: boolean; lightingAreaLightsEnabled: boolean; lightingCells: number[]; lightingCookieAtlasResolution: number; lightingCookiesEnabled: boolean; lightingMaxLightsPerCell: number; lightingShadowAtlasResolution: number; lightingShadowsEnabled: boolean; lightingShadowType: number; lightmapFilterEnabled: boolean; lightmapFilterRange: number; lightmapFilterSmoothness: number; lightmapMaxResolution: number; lightmapMode: number; lightmapSizeMultiplier: number; skybox: number | null; skyboxIntensity: number; skyboxLuminance: number; skyboxMip: number; skyboxRotation: number[]; skyCenter: number[]; skyMeshPosition: number[]; skyMeshRotation: number[]; skyMeshScale: number[]; skyType: string; tonemapping: number } }): void
-Application.applySceneSettings(settings: { physics: { gravity: number[] }; render: { ambientBake: boolean; ambientBakeNumSamples: number; ambientBakeOcclusionBrightness: number; ambientBakeOcclusionContrast: number; ambientBakeSpherePart: number; ambientLuminance: number; clusteredLightingEnabled: boolean; exposure: number; fog: string; fog_color: number[]; fog_density: number; fog_end: number; fog_start: number; gamma_correction: number; global_ambient: number[]; lightingAreaLightsEnabled: boolean; lightingCells: number[]; lightingCookieAtlasResolution: number; lightingCookiesEnabled: boolean; lightingMaxLightsPerCell: number; lightingShadowAtlasResolution: number; lightingShadowsEnabled: boolean; lightingShadowType: number; lightmapFilterEnabled: boolean; lightmapFilterRange: number; lightmapFilterSmoothness: number; lightmapMaxResolution: number; lightmapMode: number; lightmapSizeMultiplier: number; skybox: number | null; skyboxIntensity: number; skyboxLuminance: number; skyboxMip: number; skyboxRotation: number[]; skyCenter: number[]; skyMeshPosition: number[]; skyMeshRotation: number[]; skyMeshScale: number[]; skyType: string; tonemapping: number } }): void
+Application.applySceneSettings(settings: { physics: { gravity: number[] }; render: { ambientBake: boolean; ambientBakeNumSamples: number; ambientBakeOcclusionBrightness: number; ambientBakeOcclusionContrast: number; ambientBakeSpherePart: number; ambientLuminance: number; clusteredLightingEnabled: boolean; exposure: number; fog: string; fog_color: number[]; fog_density: number; fog_end: number; fog_start: number; gamma_correction: number; global_ambient: number[]; gsplatAlphaClip: number; gsplatAlphaClipForward: number; gsplatAntiAlias: boolean; gsplatColorUpdateAngle: number; gsplatCooldownTicks: number; gsplatDataFormat: string; gsplatEnableIds: boolean; gsplatFoveationCenter: number; gsplatFoveationStrength: number; gsplatLodBehindPenalty: number; gsplatLodUnderfillLimit: number; gsplatLodUpdateAngle: number; gsplatLodUpdateDistance: number; gsplatMinContribution: number; gsplatMinPixelSize: number; gsplatRadialSorting: boolean; gsplatSplatBudget: number; gsplatUseFog: boolean; lightingAreaLightsEnabled: boolean; lightingCells: number[]; lightingCookieAtlasResolution: number; lightingCookiesEnabled: boolean; lightingMaxLightsPerCell: number; lightingShadowAtlasResolution: number; lightingShadowsEnabled: boolean; lightingShadowType: number; lightmapFilterEnabled: boolean; lightmapFilterRange: number; lightmapFilterSmoothness: number; lightmapMaxResolution: number; lightmapMode: number; lightmapSizeMultiplier: number; skybox: number | null; skyboxIntensity: number; skyboxLuminance: number; skyboxMip: number; skyboxRotation: number[]; skyCenter: number[]; skyMeshPosition: number[]; skyMeshRotation: number[]; skyMeshScale: number[]; skyType: string; tonemapping: number } }): voidInformational only — this never fails the build. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes Gaussian splat (gsplat) rendering configuration round-trip through AppBase#applySceneSettings by applying serialized settings.render.gsplat* keys onto Scene#gsplat parameters, similar to how sky and lighting settings are already applied.
Changes:
- Add
GSplatParams#applySettings(render)to copysettings.render.gsplat*values into gsplat parameters while leaving unspecified values unchanged. - Call
this.gsplat.applySettings(render)fromScene#applySettings. - Document supported
settings.render.gsplat*keys inAppBase#applySceneSettingsJSDoc.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/scene/scene.js | Invokes gsplat settings application during scene settings load. |
| src/scene/gsplat-unified/gsplat-params.js | Implements GSplatParams#applySettings(render) to apply serialized render settings. |
| src/framework/app-base.js | Documents the supported settings.render.gsplat* keys for applySceneSettings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+923
to
+928
| applySettings(render) { | ||
| this.radialSorting = render.gsplatRadialSorting ?? this.radialSorting; | ||
|
|
||
| this.lodUpdateDistance = render.gsplatLodUpdateDistance ?? this.lodUpdateDistance; | ||
| this.lodUpdateAngle = render.gsplatLodUpdateAngle ?? this.lodUpdateAngle; | ||
| this.lodBehindPenalty = render.gsplatLodBehindPenalty ?? this.lodBehindPenalty; |
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.
Applies serialized scene render settings (e.g. from the Editor) to the gsplat parameters, so gsplat configuration round-trips through
AppBase#applySceneSettingslike fog, sky, and clustered lighting already do.Changes:
GSplatParams#applySettings(render)(internal) that reads flatgsplat-prefixed keys off therendersettings object, assigning through the existing setters with fallbacks (missing keys leave the current value unchanged).Scene#applySettings, alongside the existingsky/lightingdelegations.settings.render.gsplat*keys in theAppBase#applySceneSettingsJSDoc.Settings applied:
gsplatRadialSorting,gsplatLodUpdateDistance,gsplatLodUpdateAngle,gsplatLodBehindPenalty,gsplatLodUnderfillLimit,gsplatSplatBudget,gsplatAlphaClip,gsplatAlphaClipForward,gsplatMinPixelSize,gsplatMinContribution,gsplatFoveationStrength,gsplatFoveationCenter,gsplatAntiAlias,gsplatUseFog,gsplatColorUpdateAngle,gsplatCooldownTicks,gsplatDataFormat,gsplatEnableIds.No public API additions; this is additive and backward compatible.