feat: load local asset bundles in local scene development (local-ab)#9459
Draft
dalkia wants to merge 3 commits into
Draft
feat: load local asset bundles in local scene development (local-ab)#9459dalkia wants to merge 3 commits into
dalkia wants to merge 3 commits into
Conversation
Adds an lsd-local-ab app arg / launch-settings toggle so local scene development can load the scene's asset bundles from a locally running abgen server (JIT converter) instead of raw GLTFs, previewing scenes with production-grade assets. - New AppArgsFlags.LSD_LOCAL_AB + RealmLaunchSettings.useLocalAssetBundles (editor toggle under Localhost), exposed as FeatureId.LSD_LOCAL_ASSET_BUNDLES - In this mode the scene's AB manifest is fetched from optimized-assets-url (defaults to http://127.0.0.1:5147, abgen's default port) instead of the manual LSD manifest; a failed fetch degrades the whole scene to raw GLTFs - Skips the CDN scene-code override in LSD so scene code always comes from the live preview server - Disables Unity's AB disk cache in LSD (path-based dev-server hashes make any disk cache stale-prone) - Takes precedence over lsd-use-remote-ab when both are set (with warning) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dalkia
marked this pull request as draft
July 21, 2026 20:14
Open
6 tasks
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.
Pull Request Description
What does this PR change?
Local scene development (LSD) always loads raw GLTFs, so creators never preview a scene the way it renders in production (compressed BC7/BC5 textures, Unity-native meshes, converted materials). This PR adds an opt-in mode where the local scene's asset bundles are loaded from a locally running abgen server (an ab-cdn-compatible JIT converter) instead:
--local-abapp arg (also a "Use Local Asset Bundles" toggle in the Main Scene Loader inspector when Initial Realm is Localhost), exposed asFeatureId.LSD_LOCAL_ASSET_BUNDLES.--optimized-assets-url(which now defaults tohttp://127.0.0.1:5147, abgen's default port, when the flag is on and no URL is given) instead of using the manual LSD manifest. Real v49 manifests mean the existing URL/cache-key logic applies unchanged.TryOverrideWithCDNAsyncin LSD so scene code always comes from the live preview server (a real manifest version would otherwise make CDN HEAD-probes eligible).--local-abtakes precedence over--lsd-use-remote-abif both are passed (logs a warning); hybrid-scene behavior is untouched.This is the explorer half of the Creator Hub "Optimized Assets" preview feature: Creator Hub spawns abgen as a sidecar and passes these params via deeplink; the same flags also enable a pure editor/CLI workflow.
Docs:
docs/how-to-connect-to-a-local-scene.mdhas a new "Local asset bundles (abgen)" section.Test Instructions
Steps (standard run — regression):
Expected result:
Normal Genesis City play mode is unchanged (asset bundles from ab-cdn as usual). Local scene development without the new flag is unchanged (raw GLTFs).
Prerequisites
npm run start -- -p 8000in the scene foldercargo build --release --bin abgen):Test Steps
--realm http://127.0.0.1:8000 --position 0,0 --local-scene true --local-ab true --debug --skip-version-check true(no--optimized-assets-urlneeded — it defaults to abgen's port 5147). In the Unity Editor: Main Scene Loader → Initial Realm =Localhost, tickUse Local Asset Bundles, Play.ABGEN_BUILDconversion lines, then one bundle GET per asset; scene textures inspect as BC7 (raw GLTF path produces RGBA32).curl -s http://127.0.0.1:5147/metrics | grep abgen_http_requests_totalshows the client's requests..glbin the scene → scene reloads → only that asset reconverts (abgen logs arevalidate: content changedline) and the updated model appears.Additional Testing Notes
--local-ab+--lsd-use-remote-abtogether: local wins, warning logged.Quality Checklist
🤖 Generated with Claude Code