feat(core): add progressive runtime environment light capture - #3089
feat(core): add progressive runtime environment light capture#3089GuoLei1990 wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev/2.0 #3089 +/- ##
===========================================
+ Coverage 85.42% 85.66% +0.24%
===========================================
Files 811 816 +5
Lines 94654 95800 +1146
Branches 11512 11712 +200
===========================================
+ Hits 80854 82069 +1215
+ Misses 13710 13640 -70
- Partials 90 91 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
EnvironmentLightCaptureto progressively capture the activeScene.background.skyinto diffuse L2 SH and a GGX-prefiltered specular cubemap.Scene.ambientLight.Scene.sunsnapshot.API and ownership
V1 is deliberately On Demand:
requestUpdate()records the newest sky revision andupdate()submits one scheduled work slice. A newer pending revision replaces an older pending one without interrupting the revision already in flight.AmbientLightremains the authoritative owner consumed by PBR shading.EnvironmentLightCaptureowns only the capture transaction, staging resources, and publication schedule. Only one capture object can own anAmbientLightat a time, and publication switches SH plus the specular cubemap in the same update.Custom skies and the sun disk
Unity HDRP exposes the equivalent context as
SkyRenderer.RenderSky(..., renderForCubemap, renderSunDisk). Galacean skies are Material/shader based rather thanSkyRenderersubclasses, so this change provides the shader equivalents:SCENE_ENVIRONMENT_CAPTURESCENE_ENVIRONMENT_CAPTURE_INCLUDE_SUNThe built-in procedural sky now keeps atmospheric scattering in the capture but omits its analytic solar disk by default. Direct sunlight still comes from
Scene.sun. A custom procedural sky can use the same macros around its analytic disk; a disk already authored into a static cubemap cannot be removed after capture.Each requested revision clones the sky Material and snapshots
Scene.sun. Capture-varying custom parameters should live in Material shader data. Opaque Scene shader data is not copied into the private capture Scene because it also contains unrelated lighting, fog, and render-state ownership.References:
SkyRenderer: https://github.com/Unity-Technologies/Graphics/blob/master/Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/SkyRenderer.csSkySettingsupdate modes andincludeSunInBaking: https://docs.unity3d.com/cn/Packages/com.unity.render-pipelines.high-definition%407.4/api/UnityEngine.Rendering.HighDefinition.SkySettings.htmlScope
128resolution and64GGX samples are initial quality parameters, not measured performance claims.Verification
corepack pnpm buildcorepack pnpm lint(0 errors; existing repository warnings remain)corepack pnpm vitest run tests/src/core/EnvironmentLightCapture.test.ts tests/src/core/RealtimeIBLPrefilterSchedule.test.ts tests/src/core/RealtimeIBLSourceMipmapSchedule.test.ts(3 files, 4 tests)git diff --check origin/dev/2.0...HEAD