Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions lab/lite/babylon-ref-scene265.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Babylon.js Reference — Scene 265: EnvironmentTest (EXT_lights_image_based)</title>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #000;
}
canvas {
width: 100%;
height: 100%;
display: block;
}
</style>
</head>
<body>
<canvas id="renderCanvas"></canvas>
<script type="module" src="/lite/src/bjs/scene265.ts"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions lab/lite/bundle-bjs-scene265.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Babylon.js Reference — Scene 265: EnvironmentTest (EXT_lights_image_based) (Bundle)</title>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #000;
}
canvas {
width: 100%;
height: 100%;
display: block;
}
</style>
</head>
<body>
<canvas id="renderCanvas"></canvas>
<script type="module" src="/lite/bundle/bjs-scene265.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions lab/lite/bundle-scene265.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Babylon Lite — Scene 265: EnvironmentTest (EXT_lights_image_based) (Bundle)</title>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #000;
}
canvas {
width: 100%;
height: 100%;
display: block;
}
</style>
</head>
<body>
<canvas id="renderCanvas"></canvas>
<script src="/loader.js"></script>
<script type="module" src="/lite/bundle/scene265.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions lab/lite/scene265.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Babylon Lite — Scene 265: EnvironmentTest (EXT_lights_image_based)</title>
<style>
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #000;
}
canvas {
width: 100%;
height: 100%;
display: block;
}
</style>
</head>
<body>
<canvas id="renderCanvas"></canvas>
<script src="/loader.js"></script>
<script type="module" src="/lite/src/lite/scene265.ts"></script>
</body>
</html>
45 changes: 45 additions & 0 deletions lab/lite/src/bjs/scene265.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ArcRotateCamera } from "@babylonjs/core/Cameras/arcRotateCamera";
import { Color4 } from "@babylonjs/core/Maths/math.color";
import { WebGPUEngine } from "@babylonjs/core/Engines/webgpuEngine";
import "@babylonjs/core/Helpers/sceneHelpers";
import "@babylonjs/core/Loading/loadingScreen";
import { SceneLoader } from "@babylonjs/core/Loading/sceneLoader";
import { Scene } from "@babylonjs/core/scene";
import "@babylonjs/loaders/glTF";

const MODEL_URL = "https://cx20.github.io/gltf-test/tutorialModels/EnvironmentTest/glTF-IBL/EnvironmentTest.gltf";

(async function () {
const __initStart = performance.now();
const canvas = document.getElementById("renderCanvas") as HTMLCanvasElement;
const engine = new WebGPUEngine(canvas, { antialias: true, adaptToDeviceRatio: true });
await engine.initAsync();
engine.displayLoadingUI = function () {};

const scene = new Scene(engine);
scene.clearColor = new Color4(0.2, 0.2, 0.3, 1.0);

// The glTF's EXT_lights_image_based extension installs scene.environmentTexture.
await SceneLoader.AppendAsync("", MODEL_URL, scene);

// Match loadEnvironment's image-processing defaults (the Lite extension sets these).
scene.imageProcessingConfiguration.exposure = 0.8;
scene.imageProcessingConfiguration.contrast = 1.2;
scene.imageProcessingConfiguration.toneMappingEnabled = true;

// Same auto-framing formula as Lite's createDefaultCamera; override angles to match.
scene.createDefaultCamera(true, true, true);
const camera = scene.activeCamera as ArcRotateCamera;
camera.alpha = Math.PI / 2;
camera.beta = Math.PI / 2.5;

await scene.whenReadyAsync();
engine.runRenderLoop(() => scene.render());
window.addEventListener("resize", () => engine.resize());

await new Promise<void>((resolve) => scene.onAfterRenderObservable.addOnce(() => resolve()));
canvas.dataset.camAlpha = String(camera.alpha);
canvas.dataset.camRadius = String(camera.radius);
canvas.dataset.initMs = String(performance.now() - __initStart);
canvas.dataset.ready = "true";
})().catch(console.error);
34 changes: 34 additions & 0 deletions lab/lite/src/lite/scene265.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Scene 265 — EnvironmentTest (cx20 gltf-test parity).
// Exercises EXT_lights_image_based: the glTF carries its own image-based light
// (irradiance SH9 + prefiltered specular cubemap), so we do NOT call
// loadEnvironment — the extension installs the environment onto the scene.
import { addToScene, startEngine, createEngine, createSceneContext, createDefaultCamera, loadGltf, attachControl, registerScene } from "babylon-lite";

const MODEL_URL = "https://cx20.github.io/gltf-test/tutorialModels/EnvironmentTest/glTF-IBL/EnvironmentTest.gltf";

async function main(): Promise<void> {
const __initStart = performance.now();
const canvas = document.getElementById("renderCanvas") as HTMLCanvasElement;

const engine = await createEngine(canvas);
const scene = createSceneContext(engine);
scene.clearColor = { r: 0.2, g: 0.2, b: 0.3, a: 1.0 };

const root = await loadGltf(engine, MODEL_URL);
addToScene(scene, root);

const cam = createDefaultCamera(scene);
cam.alpha = Math.PI / 2;
cam.beta = Math.PI / 2.5;
attachControl(cam, canvas, scene);

await registerScene(scene);
await startEngine(engine);
(window as any).__scene = scene;
canvas.dataset.camAlpha = String(cam.alpha);
canvas.dataset.camRadius = String(cam.radius);
canvas.dataset.initMs = String(performance.now() - __initStart);
canvas.dataset.ready = "true";
}

main().catch(console.error);
4 changes: 2 additions & 2 deletions lab/public/bundle/manifest/scene104.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"rawKB": 101.4,
"rawKB": 101.5,
"gzipKB": 39.2,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene104-generate-mipmaps-C2O_HNRi.js",
"scene104-gltf-feature-registry-BOpBaZNy.js",
"scene104-gltf-feature-registry-B_rK3afU.js",
"scene104-gltf-glb-parser-BJfNq64D.js",
"scene104-shader-composer-DishuYLa.js",
"scene104-standard-renderable-CHoHvWO9.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene105.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"rawKB": 102.1,
"gzipKB": 39.4,
"rawKB": 102.2,
"gzipKB": 39.5,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene105-generate-mipmaps-q97-3GGe.js",
"scene105-gltf-feature-registry-GXOsvmf1.js",
"scene105-gltf-feature-registry-DKfE0vzV.js",
"scene105-gltf-glb-parser-BsWC1iTB.js",
"scene105-shader-composer-DishuYLa.js",
"scene105-standard-renderable-BXA9dKAx.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene11.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rawKB": 89,
"gzipKB": 37.4,
"rawKB": 89.1,
"gzipKB": 37.5,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene11-create-skeleton-D-3exD5E.js",
Expand All @@ -9,7 +9,7 @@
"scene11-gltf-ext-spec-gloss-D60sFZYX.js",
"scene11-gltf-feature-animations-CUKuLYEP.js",
"scene11-gltf-feature-extras-VHPteGay.js",
"scene11-gltf-feature-registry-HI7s4KMP.js",
"scene11-gltf-feature-registry-CoWTXZ-o.js",
"scene11-gltf-feature-skeleton-Djlep9zW.js",
"scene11-gltf-glb-parser-B0CzN8nR.js",
"scene11-gltf-sampler-desc-DP9TFn1W.js",
Expand Down
4 changes: 2 additions & 2 deletions lab/public/bundle/manifest/scene112.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rawKB": 120,
"rawKB": 120.1,
"gzipKB": 48.8,
"ignoredRawKB": 0,
"runtimeChunks": [
Expand All @@ -9,7 +9,7 @@
"scene112-generate-mipmaps-r2o5vX6L.js",
"scene112-gltf-ext-basisu-CRSWpXls.js",
"scene112-gltf-ext-dielectric-C6hvXXiF.js",
"scene112-gltf-feature-registry-CsinE8Td.js",
"scene112-gltf-feature-registry-CBflmSLe.js",
"scene112-gltf-json-asset-Cj8WBr3J.js",
"scene112-ibl-fragment-CeRrvT96.js",
"scene112-pbr-refraction-nAlT2yO6.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene115.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rawKB": 126.4,
"gzipKB": 52.1,
"rawKB": 126.5,
"gzipKB": 52.2,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene115-create-morph-targets-BxcR5t59.js",
Expand All @@ -10,7 +10,7 @@
"scene115-gltf-color-normalize-4-WGzPL2.js",
"scene115-gltf-feature-animations-DOqxEAHR.js",
"scene115-gltf-feature-morph-DLWJRlR1.js",
"scene115-gltf-feature-registry-v5cVaPih.js",
"scene115-gltf-feature-registry-BjqhkauT.js",
"scene115-gltf-feature-skeleton-BktZKWC9.js",
"scene115-gltf-json-asset-DXBgrt5f.js",
"scene115-morph-fragment-BbCT_r5m.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene12.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"rawKB": 103.5,
"gzipKB": 42.2,
"rawKB": 103.6,
"gzipKB": 42.3,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene12-create-skeleton-yE34pa8K.js",
"scene12-generate-mipmaps-WJd2dKx2.js",
"scene12-gltf-animation-BQj3RAlu.js",
"scene12-gltf-feature-animations-Db5mzwHK.js",
"scene12-gltf-feature-registry-BvvuIzLS.js",
"scene12-gltf-feature-registry-DvTgP0Jo.js",
"scene12-gltf-feature-skeleton-eatI5LFE.js",
"scene12-gltf-glb-parser-BrsOlymf.js",
"scene12-ibl-fragment-CeRrvT96.js",
Expand Down
2 changes: 1 addition & 1 deletion lab/public/bundle/manifest/scene127.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rawKB": 61.3,
"rawKB": 61.4,
"gzipKB": 23.5,
"ignoredRawKB": 0,
"runtimeChunks": [
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene144.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rawKB": 110.5,
"gzipKB": 44.7,
"rawKB": 110.6,
"gzipKB": 44.8,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene144-create-skeleton-DalWacs1.js",
Expand All @@ -9,7 +9,7 @@
"scene144-gltf-ext-spec-gloss-D60sFZYX.js",
"scene144-gltf-feature-animations-CvLpEQNh.js",
"scene144-gltf-feature-extras-VHPteGay.js",
"scene144-gltf-feature-registry-ByT8hALD.js",
"scene144-gltf-feature-registry-C4zDl2lJ.js",
"scene144-gltf-feature-skeleton-Dvlpv1pW.js",
"scene144-gltf-glb-parser-CXf6hcyj.js",
"scene144-gltf-pbr-builder-ext-g9qXikef.js",
Expand Down
4 changes: 2 additions & 2 deletions lab/public/bundle/manifest/scene147.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"rawKB": 103.7,
"rawKB": 103.8,
"gzipKB": 41.6,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene147-directional-light-Bhj3CbsK.js",
"scene147-generate-mipmaps-7FMQd9Gb.js",
"scene147-gltf-feature-lights-punctual-CwjriEB4.js",
"scene147-gltf-feature-registry-Dj5aS1Qx.js",
"scene147-gltf-feature-registry-f8l66LCT.js",
"scene147-gltf-glb-parser-1VrmmUS3.js",
"scene147-gltf-light-pointer-state-B7kFTRxK.js",
"scene147-multilight-wgsl-EMm1KlC7.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene148.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"rawKB": 109.6,
"gzipKB": 43.1,
"rawKB": 109.8,
"gzipKB": 43.2,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene148-directional-light-UoLzTD31.js",
"scene148-generate-mipmaps-CfuW6q-h.js",
"scene148-gltf-feature-lights-punctual-BTZaThsN.js",
"scene148-gltf-feature-registry-BeLwYcCC.js",
"scene148-gltf-feature-registry-CG_xHMUj.js",
"scene148-gltf-glb-parser-BR2EHjxU.js",
"scene148-gltf-light-pointer-state-B7kFTRxK.js",
"scene148-pbr-geometry-view-VyZljgCl.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene149.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rawKB": 109,
"gzipKB": 44.5,
"rawKB": 109.1,
"gzipKB": 44.6,
"ignoredRawKB": 6.8,
"runtimeChunks": [
"scene149-_math-factory-DFVyS8gB.js",
Expand All @@ -9,7 +9,7 @@
"scene149-generate-mipmaps-gtcbk4S2.js",
"scene149-geometry-texture-output-BfeQftmX.js",
"scene149-gltf-feature-lights-punctual-D7xjFqdg.js",
"scene149-gltf-feature-registry-D8cKsNpu.js",
"scene149-gltf-feature-registry-ZWJbcsHU.js",
"scene149-gltf-glb-parser-CpRY-0L4.js",
"scene149-gltf-light-pointer-state-B7kFTRxK.js",
"scene149-input-block-BTUtjdzr.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene152.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rawKB": 94.1,
"gzipKB": 39.1,
"rawKB": 94.2,
"gzipKB": 39.2,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene152-create-skeleton-BvRoBRkx.js",
Expand All @@ -9,7 +9,7 @@
"scene152-gltf-ext-spec-gloss-D60sFZYX.js",
"scene152-gltf-feature-animations-B_C5kwG5.js",
"scene152-gltf-feature-extras-VHPteGay.js",
"scene152-gltf-feature-registry-B7gVMsrH.js",
"scene152-gltf-feature-registry-CLQZbp4N.js",
"scene152-gltf-feature-skeleton-CUsQ3cht.js",
"scene152-gltf-glb-parser-Dr_B2hXm.js",
"scene152-gltf-sampler-desc-D0Q2VM93.js",
Expand Down
6 changes: 3 additions & 3 deletions lab/public/bundle/manifest/scene157.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"rawKB": 95.5,
"gzipKB": 38.9,
"rawKB": 95.6,
"gzipKB": 39,
"ignoredRawKB": 0,
"runtimeChunks": [
"scene157-create-skeleton-CSKHrTlw.js",
"scene157-generate-mipmaps-BYHWBGCp.js",
"scene157-gltf-animation-PnQa26Zh.js",
"scene157-gltf-feature-animations-at7-WE4C.js",
"scene157-gltf-feature-registry-CUqIEUA4.js",
"scene157-gltf-feature-registry-DlyUXqwJ.js",
"scene157-gltf-feature-skeleton-Cxp-WFUs.js",
"scene157-gltf-glb-parser-DZ4Xgxsa.js",
"scene157-multilight-wgsl-BVR6TJvC.js",
Expand Down
Loading