Skip to content

feat(pbr): add bundle-conscious shadow-only material mode#420

Merged
ryantrem merged 8 commits into
masterfrom
feature/pbr-shadow-only-material
Jul 17, 2026
Merged

feat(pbr): add bundle-conscious shadow-only material mode#420
ryantrem merged 8 commits into
masterfrom
feature/pbr-shadow-only-material

Conversation

@ryantrem

@ryantrem ryantrem commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds an opt-in shadow-only receiver mode to the PBR material, mirroring BJS BackgroundMaterial.shadowOnly: the surface is invisible except where a shadow falls on it. This is used by the Babylon.js Viewer Lite to render a soft grounding shadow under loaded models.

Design goal: zero size for scenes that don't use it

The heavy code lives in a new fragments/shadow-only-fragment.ts that pbr-renderable dynamically imports only when a mesh has shadowOnly === true, following the same lazy pattern as the emissive/unlit/skeleton/morph fragments. The only always-loaded cost is the standard ~100-byte fragment wiring (the import-registration entry + a hasAnyShadowOnly flag) plus a 7-byte /*FA*/ template slot marker, consistent with the existing slot markers.

New material props (all optional, type-only until used)

  • shadowOnly
  • shadowOnlyColor
  • shadowOnlyOpacity
  • shadowOnlyFalloff

Implementation

  • BC slot: unroll min() over the local shadowFactors array and override color/alpha with the shadow term.
  • New FA slot (emitted after the alpha block's luminanceOverAlpha fold) overwrites finalAlpha with the pure shadow term. Needed because IBL is scene-scoped and finalSpecularScaled is an immutable let, so the environment/direct specular luminance can't be zeroed from BC and would otherwise make the shadow catcher opaque.
  • scene-core: make ensureShadowTask idempotent so re-registration doesn't stack duplicate shadow tasks.

Bundle impact

Bundle manifests regenerated (pnpm build:bundle-scenes): PBR scenes grow a uniform ~0.1 KB from the shared wiring. 33 scenes whose ceilings were pinned at zero headroom are bumped by 0.1 KB (0.2 KB where the overage exceeded 0.1 KB) in scene-config.json. Verified 0 scenes over ceiling and live bundle-size tests pass.

Following the current architecture for PBR materials, the size must grow (as we must add at least the dynamic import code). However, I have some ideas to reduce this, but it's a big change to how PBR materials work, so I need to talk with @deltakosh or @Popov72 before making that change.

ryantrem and others added 2 commits July 15, 2026 20:52
Adds an opt-in shadow-only receiver mode to the PBR material, mirroring
BJS `BackgroundMaterial.shadowOnly`: the surface is invisible except
where a shadow falls on it. This is used by the Babylon.js Viewer Lite to
render a soft grounding shadow under loaded models.

Design goal: zero size for scenes that don't use it. The heavy code lives
in a new `fragments/shadow-only-fragment.ts` that pbr-renderable
dynamically imports only when a mesh has `shadowOnly === true`, following
the same lazy pattern as the emissive/unlit/skeleton/morph fragments. The
only always-loaded cost is the standard ~100-byte fragment wiring (the
import-registration entry + a `hasAnyShadowOnly` flag) plus a 7-byte
`/*FA*/` template slot marker, consistent with the existing slot markers.

New material props (all optional, type-only until used):
- shadowOnly, shadowOnlyColor, shadowOnlyOpacity, shadowOnlyFalloff

Implementation:
- BC slot: unroll min() over the local shadowFactors array and override
  color/alpha with the shadow term.
- New FA slot (emitted after the alpha block's luminanceOverAlpha fold)
  overwrites finalAlpha with the pure shadow term. Needed because IBL is
  scene-scoped and finalSpecularScaled is an immutable `let`, so the
  environment/direct specular luminance can't be zeroed from BC and would
  otherwise make the shadow catcher opaque.
- scene-core: make ensureShadowTask idempotent so re-registration doesn't
  stack duplicate shadow tasks.

Bundle manifests regenerated (pnpm build:bundle-scenes): PBR scenes grow a
uniform ~0.1 KB from the shared wiring. 33 scenes whose ceilings were
pinned at zero headroom are bumped by 0.1 KB (0.2 KB where the overage
exceeded 0.1 KB) in scene-config.json. Verified 0 scenes over ceiling and
live bundle-size tests pass.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93918bc8-d76d-4c00-9edf-55be69210e04
Copilot AI review requested due to automatic review settings July 16, 2026 18:25
@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 0910ad69..6c850116 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3510,6 +3510,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260716.3 - merge @ dead6f3

The multi-line code span containing array<f32, MAX_LIGHTS> tripped the
tsdoc/syntax lint rule (missing closing backtick + unescaped >). Keep the
code span on a single line so lint passes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93918bc8-d76d-4c00-9edf-55be69210e04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in shadow-only receiver mode to the PBR material (BJS BackgroundMaterial.shadowOnly-style) while keeping bundle impact minimal via a lazy-loaded fragment and a new shader injection slot.

Changes:

  • Adds shadowOnly* PBR material props and a lazily imported shadow-only fragment that overrides color/alpha using shadow factors.
  • Introduces a new fragment injection slot FA (template marker /*FA*/) to override finalAlpha after the luminance-over-alpha fold.
  • Makes ensureShadowTask idempotent on scene re-register to avoid stacking duplicate shadow tasks; regenerates per-scene bundle manifests and updates scene-config.json ceilings.

Reviewed changes

Copilot reviewed 90 out of 90 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scene-config.json Updates per-scene maxRawKB ceilings.
packages/babylon-lite/src/shader/fragment-types.ts Adds new fragment slot type "FA".
packages/babylon-lite/src/scene/scene-core.ts Makes shadow task installation idempotent to avoid duplicates.
packages/babylon-lite/src/material/pbr/pbr-template.ts Adds /*FA*/ marker after the alpha luminance fold.
packages/babylon-lite/src/material/pbr/pbr-renderable.ts Tracks hasAnyShadowOnly and lazily imports the new fragment module.
packages/babylon-lite/src/material/pbr/pbr-material.ts Adds shadowOnly* optional material props.
packages/babylon-lite/src/material/pbr/fragments/shadow-only-fragment.ts New shadow-only fragment (BC + FA slots) + UBO writer + PBR extension.
lab/public/bundle/manifest/scene1.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene5.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene6.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene7.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene8.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene10.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene11.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene12.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene13.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene14.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene17.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene18.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene19.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene20.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene21.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene22.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene23.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene26.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene27.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene28.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene29.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene30.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene31.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene32.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene33.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene34.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene35.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene37.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene39.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene66.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene72.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene73.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene99.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene111.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene112.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene114.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene115.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene116.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene141.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene144.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene146.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene147.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene148.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene152.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene157.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene158.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene164.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene171.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene174.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene175.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene176.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene177.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene178.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene179.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene210.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene211.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene212.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene214.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene215.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene216.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene217.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene218.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene219.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene229.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene240.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene241.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene242.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene243.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene244.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene245.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene246.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene247.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene248.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene249.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene251.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene253.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene254.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene255.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene257.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene258.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene259.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene260.json Bundle manifest regen (size/chunk hash updates).
lab/public/bundle/manifest/scene265.json Bundle manifest regen (size/chunk hash updates).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scene-config.json
Comment thread packages/babylon-lite/src/shader/fragment-types.ts
Comment thread packages/babylon-lite/src/material/pbr/pbr-template.ts
@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 0910ad69..6c850116 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3510,6 +3510,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260716.4 - merge @ 11c6a2b

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Bundle Size Changes

Increases

Package Current Master Change
Scene 6 — PBR Gold Sphere
scene6
73 KB 72 KB +1 KB
Scene 14 — Flight Helmet
scene14
89 KB 88 KB +1 KB
Scene 19 — PBR Clearcoat
scene19
71 KB 70 KB +1 KB
Scene 39 — KHR_animation_pointer (Animated Waterfall)
scene39
110 KB 109 KB +1 KB
Scene 111 — Light Selection Stress Test
scene111
135 KB 134 KB +1 KB
Scene 152 — Unified AnimationManager
scene152
95 KB 94 KB +1 KB
Scene 174 - Navigation Off-Mesh Connections
scene174
97 KB 96 KB +1 KB
Scene 212 - DispersionTest glTF
scene212
105 KB 104 KB +1 KB
Scene 214 — Cascaded Shadow Maps
scene214
69 KB 68 KB +1 KB
Scene 255 — Skin Weights (Byte)
scene255
95 KB 94 KB +1 KB

Sizes rounded to nearest KB. Run pnpm build:bundle-scenes locally to verify.

The master merge (#419 CSM texture + picking fragment coords) plus the
shadow-only shared PBR wiring (~0.1 KB) pushed 19 scenes whose maxRawKB
was pinned at the exact measured size just past the unrounded ceiling
check (failing by <0.05 KB - reported as +0.0 KB over). Give each ~0.5 KB
headroom, matching the convention of already-passing scenes, so live
build/measurement jitter no longer trips the check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93918bc8-d76d-4c00-9edf-55be69210e04
@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260716.5 - merge @ c76d57a

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 0910ad69..6c850116 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3510,6 +3510,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

Shadow-only materials now force PBR_HAS_ALPHA_BLEND from the fragment's
detect() hook so the shadow catcher composites correctly regardless of
whether the caller set alpha/alphaBlend. This is required for two reasons:
isTransparent in pbr-renderable keys off PBR_HAS_ALPHA_BLEND to admit the
mesh into the transparent pass with GPU blending, and the /*FA*/ template
slot only exists in the alpha-blend branch. The bit is already in the
shared chunk, so this adds no bytes to scenes that never load the fragment.

Also addresses reviewer feedback:
- Document the FA (and BC/BA/AT/AC) fragment slots in fragment-types.ts.
- Reserve bit 1<<30 (PBR2_HAS_SHADOW_ONLY) in pbr-flag-bits.ts.
- Add a shader-integration test covering the BC + FA slot injection and
  verifying the FA override lands after the luminanceOverAlpha fold.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93918bc8-d76d-4c00-9edf-55be69210e04
@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 0910ad69..6c850116 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3510,6 +3510,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260716.6 - merge @ 5419223

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Bundle Size Changes

Increases

Package Current Master Change
Scene 6 — PBR Gold Sphere
scene6
73 KB 72 KB +1 KB
Scene 14 — Flight Helmet
scene14
89 KB 88 KB +1 KB
Scene 19 — PBR Clearcoat
scene19
71 KB 70 KB +1 KB
Scene 39 — KHR_animation_pointer (Animated Waterfall)
scene39
110 KB 109 KB +1 KB
Scene 111 — Light Selection Stress Test
scene111
135 KB 134 KB +1 KB
Scene 152 — Unified AnimationManager
scene152
95 KB 94 KB +1 KB
Scene 174 - Navigation Off-Mesh Connections
scene174
97 KB 96 KB +1 KB
Scene 212 - DispersionTest glTF
scene212
105 KB 104 KB +1 KB
Scene 214 — Cascaded Shadow Maps
scene214
69 KB 68 KB +1 KB
Scene 255 — Skin Weights (Byte)
scene255
95 KB 94 KB +1 KB

Sizes rounded to nearest KB. Run pnpm build:bundle-scenes locally to verify.

The 19 ceilings raised in 03ec4d9 only needed to clear sub-0.05 KB
boundary jitter (every CI failure was "+0.0 KB over" = actual overage
under 0.05 KB). +0.5 KB was excessive; +0.1 KB gives ~2x margin over the
maximum observed jitter while keeping the ceilings honest to the real
measured sizes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93918bc8-d76d-4c00-9edf-55be69210e04
@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 0910ad69..6c850116 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3510,6 +3510,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260716.7 - merge @ 847e81e

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Bundle Size Changes

Increases

Package Current Master Change
Scene 6 — PBR Gold Sphere
scene6
73 KB 72 KB +1 KB
Scene 14 — Flight Helmet
scene14
89 KB 88 KB +1 KB
Scene 19 — PBR Clearcoat
scene19
71 KB 70 KB +1 KB
Scene 39 — KHR_animation_pointer (Animated Waterfall)
scene39
110 KB 109 KB +1 KB
Scene 111 — Light Selection Stress Test
scene111
135 KB 134 KB +1 KB
Scene 152 — Unified AnimationManager
scene152
95 KB 94 KB +1 KB
Scene 174 - Navigation Off-Mesh Connections
scene174
97 KB 96 KB +1 KB
Scene 212 - DispersionTest glTF
scene212
105 KB 104 KB +1 KB
Scene 214 — Cascaded Shadow Maps
scene214
69 KB 68 KB +1 KB
Scene 255 — Skin Weights (Byte)
scene255
95 KB 94 KB +1 KB

Sizes rounded to nearest KB. Run pnpm build:bundle-scenes locally to verify.

…nk hash

The shadow-only detect() change altered the shared pbr-renderable chunk
content, changing its content-hash filename across every PBR scene. Rebuilt
via 'pnpm build:bundle-scenes' and committed the regenerated
lab/public/bundle/manifest/<scene>.json files so the tracked baseline
matches the code (validate:bundle-manifest requirement).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 93918bc8-d76d-4c00-9edf-55be69210e04
@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 0910ad69..6c850116 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3510,6 +3510,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260716.8 - merge @ 3b8f4dc

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Bundle Size Changes

Increases

Package Current Master Change
Scene 6 — PBR Gold Sphere
scene6
73 KB 72 KB +1 KB
Scene 14 — Flight Helmet
scene14
89 KB 88 KB +1 KB
Scene 19 — PBR Clearcoat
scene19
71 KB 70 KB +1 KB
Scene 39 — KHR_animation_pointer (Animated Waterfall)
scene39
110 KB 109 KB +1 KB
Scene 111 — Light Selection Stress Test
scene111
135 KB 134 KB +1 KB
Scene 152 — Unified AnimationManager
scene152
95 KB 94 KB +1 KB
Scene 174 - Navigation Off-Mesh Connections
scene174
97 KB 96 KB +1 KB
Scene 212 - DispersionTest glTF
scene212
105 KB 104 KB +1 KB
Scene 214 — Cascaded Shadow Maps
scene214
69 KB 68 KB +1 KB
Scene 255 — Skin Weights (Byte)
scene255
95 KB 94 KB +1 KB

Sizes rounded to nearest KB. Run pnpm build:bundle-scenes locally to verify.

@bjsplat

bjsplat commented Jul 16, 2026

Copy link
Copy Markdown

Lab - Static Site

Open deployed site

Build 20260716.8 - merge @ 3b8f4dc

@ryantrem
ryantrem enabled auto-merge (squash) July 17, 2026 01:57
…only-material

# Conflicts:
#	lab/public/bundle/manifest/scene1.json
#	lab/public/bundle/manifest/scene10.json
#	lab/public/bundle/manifest/scene11.json
#	lab/public/bundle/manifest/scene111.json
#	lab/public/bundle/manifest/scene112.json
#	lab/public/bundle/manifest/scene114.json
#	lab/public/bundle/manifest/scene115.json
#	lab/public/bundle/manifest/scene116.json
#	lab/public/bundle/manifest/scene12.json
#	lab/public/bundle/manifest/scene13.json
#	lab/public/bundle/manifest/scene14.json
#	lab/public/bundle/manifest/scene141.json
#	lab/public/bundle/manifest/scene144.json
#	lab/public/bundle/manifest/scene146.json
#	lab/public/bundle/manifest/scene147.json
#	lab/public/bundle/manifest/scene148.json
#	lab/public/bundle/manifest/scene152.json
#	lab/public/bundle/manifest/scene157.json
#	lab/public/bundle/manifest/scene158.json
#	lab/public/bundle/manifest/scene164.json
#	lab/public/bundle/manifest/scene17.json
#	lab/public/bundle/manifest/scene171.json
#	lab/public/bundle/manifest/scene174.json
#	lab/public/bundle/manifest/scene175.json
#	lab/public/bundle/manifest/scene176.json
#	lab/public/bundle/manifest/scene177.json
#	lab/public/bundle/manifest/scene178.json
#	lab/public/bundle/manifest/scene179.json
#	lab/public/bundle/manifest/scene19.json
#	lab/public/bundle/manifest/scene20.json
#	lab/public/bundle/manifest/scene21.json
#	lab/public/bundle/manifest/scene210.json
#	lab/public/bundle/manifest/scene211.json
#	lab/public/bundle/manifest/scene212.json
#	lab/public/bundle/manifest/scene215.json
#	lab/public/bundle/manifest/scene216.json
#	lab/public/bundle/manifest/scene217.json
#	lab/public/bundle/manifest/scene218.json
#	lab/public/bundle/manifest/scene219.json
#	lab/public/bundle/manifest/scene22.json
#	lab/public/bundle/manifest/scene229.json
#	lab/public/bundle/manifest/scene23.json
#	lab/public/bundle/manifest/scene240.json
#	lab/public/bundle/manifest/scene241.json
#	lab/public/bundle/manifest/scene242.json
#	lab/public/bundle/manifest/scene243.json
#	lab/public/bundle/manifest/scene244.json
#	lab/public/bundle/manifest/scene245.json
#	lab/public/bundle/manifest/scene246.json
#	lab/public/bundle/manifest/scene247.json
#	lab/public/bundle/manifest/scene248.json
#	lab/public/bundle/manifest/scene249.json
#	lab/public/bundle/manifest/scene251.json
#	lab/public/bundle/manifest/scene253.json
#	lab/public/bundle/manifest/scene254.json
#	lab/public/bundle/manifest/scene255.json
#	lab/public/bundle/manifest/scene257.json
#	lab/public/bundle/manifest/scene258.json
#	lab/public/bundle/manifest/scene259.json
#	lab/public/bundle/manifest/scene26.json
#	lab/public/bundle/manifest/scene260.json
#	lab/public/bundle/manifest/scene265.json
#	lab/public/bundle/manifest/scene27.json
#	lab/public/bundle/manifest/scene28.json
#	lab/public/bundle/manifest/scene29.json
#	lab/public/bundle/manifest/scene30.json
#	lab/public/bundle/manifest/scene31.json
#	lab/public/bundle/manifest/scene32.json
#	lab/public/bundle/manifest/scene33.json
#	lab/public/bundle/manifest/scene34.json
#	lab/public/bundle/manifest/scene35.json
#	lab/public/bundle/manifest/scene37.json
#	lab/public/bundle/manifest/scene39.json
#	lab/public/bundle/manifest/scene5.json
#	lab/public/bundle/manifest/scene6.json
#	lab/public/bundle/manifest/scene66.json
#	lab/public/bundle/manifest/scene7.json
#	lab/public/bundle/manifest/scene72.json
#	lab/public/bundle/manifest/scene73.json
#	lab/public/bundle/manifest/scene8.json
#	lab/public/bundle/manifest/scene99.json
@bjsplat

bjsplat commented Jul 17, 2026

Copy link
Copy Markdown

API Changes

API Extractor detected public API changes for @babylonjs/lite.

No removed public API lines were detected; this appears to be additive.

API Extractor diff
diff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 2778db08..8b01b942 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3513,6 +3513,10 @@ export interface PbrMaterialProps extends Material {
     reflectance?: number;
     reflectanceTexture?: Texture2D;
     roughnessFactor?: number;
+    shadowOnly?: boolean;
+    shadowOnlyColor?: [number, number, number];
+    shadowOnlyFalloff?: number;
+    shadowOnlyOpacity?: number;
     sheen?: SheenProps;
     skyboxMode?: boolean;
     specGlossTexture?: Texture2D;

@bjsplat

bjsplat commented Jul 17, 2026

Copy link
Copy Markdown

Lite Playground - Static Site

Open deployed site

Build 20260717.18 - merge @ e9a9371

@bjsplat

bjsplat commented Jul 17, 2026

Copy link
Copy Markdown

Bundle Size Changes

Increases

Package Current Master Change
Scene 6 — PBR Gold Sphere
scene6
73 KB 72 KB +1 KB
Scene 19 — PBR Clearcoat
scene19
71 KB 70 KB +1 KB
Scene 29 — Sheen Cloth glTF
scene29
91 KB 90 KB +1 KB
Scene 242 — EmissiveFireflies
scene242
98 KB 97 KB +1 KB
Scene 255 — Skin Weights (Byte)
scene255
95 KB 94 KB +1 KB

Sizes rounded to nearest KB. Run pnpm build:bundle-scenes locally to verify.

@bjsplat

bjsplat commented Jul 17, 2026

Copy link
Copy Markdown

Lab - Static Site

Open deployed site

Build 20260717.18 - merge @ e9a9371

@ryantrem
ryantrem merged commit 91ef15d into master Jul 17, 2026
12 checks passed
@ryantrem
ryantrem deleted the feature/pbr-shadow-only-material branch July 17, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants