Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

chore(examples): Bistro at blue hour with the street lamps lit

yhhcab26d1d8a6b
diff --git a/.github/workflows/editor-acceptance.yml b/.github/workflows/editor-acceptance.yml
index 86e1e0aa4..2b7710401 100644
--- a/.github/workflows/editor-acceptance.yml
+++ b/.github/workflows/editor-acceptance.yml
@@ -26,8 +26,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
- ESTELLA_WIN_W: '1480'
- ESTELLA_WIN_H: '920'
+ ESTELLA_WIN_W: ${{ contains(inputs.checks, 'docs-hero') && '1900' || '1480' }}
+ ESTELLA_WIN_H: ${{ contains(inputs.checks, 'docs-hero') && '1060' || '920' }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/editor-checkout
diff --git a/examples/bistro/assets/models/BistroExterior.esprefab b/examples/bistro/assets/models/BistroExterior.esprefab
index 6e7903a66..57ae3c1f8 100644
--- a/examples/bistro/assets/models/BistroExterior.esprefab
+++ b/examples/bistro/assets/models/BistroExterior.esprefab
@@ -54,13 +54,6 @@
{
"type": "Transform",
"data": {}
- },
- {
- "type": "TimelinePlayer",
- "data": {
- "timeline": "assets/models/BistroExterior_Take_001.estimeline",
- "playing": false
- }
}
]
},
diff --git a/examples/bistro/assets/scenes/main.esscene b/examples/bistro/assets/scenes/main.esscene
index 7b2668962..080b529e8 100644
--- a/examples/bistro/assets/scenes/main.esscene
+++ b/examples/bistro/assets/scenes/main.esscene
@@ -57,19 +57,19 @@
"type": "bloom",
"enabled": true,
"uniforms": {
- "u_threshold": 0.9,
- "u_intensity": 0.8,
- "u_radius": 1.3
+ "u_threshold": 0.75,
+ "u_intensity": 1.1,
+ "u_radius": 1.5
}
},
{
"type": "colorGrade",
"enabled": true,
"uniforms": {
- "u_exposure": 0,
- "u_contrast": 1.06,
- "u_saturation": 1.08,
- "u_temperature": 0.06,
+ "u_exposure": 0.05,
+ "u_contrast": 1.1,
+ "u_saturation": 1.05,
+ "u_temperature": -0.04,
"u_tint": 0
}
},
@@ -77,7 +77,7 @@
"type": "tonemap",
"enabled": true,
"uniforms": {
- "u_exposure": 0.1
+ "u_exposure": 0.15
}
},
{
@@ -128,12 +128,12 @@
"data": {
"type": 1,
"color": {
- "r": 1,
- "g": 0.72,
- "b": 0.46,
+ "r": 0.62,
+ "g": 0.68,
+ "b": 0.95,
"a": 1
},
- "intensity": 1.9,
+ "intensity": 0.7,
"enabled": true,
"meshShadows": true,
"shadowExtent": 2600,
@@ -170,7 +170,7 @@
"b": 1,
"a": 1
},
- "intensity": 0.8,
+ "intensity": 0.5,
"enabled": true,
"environment": "assets/env/the_sky_is_on_fire_2k.esenv",
"drawEnvironment": true
@@ -197,6 +197,546 @@
],
"added": [],
"removed": []
+ },
+ {
+ "id": 4,
+ "name": "Lamp 1",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -2028,
+ "y": 420,
+ "z": -712
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 5,
+ "name": "Lamp 2",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -1773,
+ "y": 420,
+ "z": -1494
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 6,
+ "name": "Lamp 3",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -1194,
+ "y": 420,
+ "z": -962
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 7,
+ "name": "Lamp 4",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -851,
+ "y": 420,
+ "z": -1151
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 8,
+ "name": "Lamp 5",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -220,
+ "y": 420,
+ "z": -1838
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 9,
+ "name": "Lamp 6",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -966,
+ "y": 420,
+ "z": 206
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 10,
+ "name": "Lamp 7",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -209,
+ "y": 420,
+ "z": 465
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 11,
+ "name": "Lamp 8",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -176,
+ "y": 420,
+ "z": 1004
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 12,
+ "name": "Lamp 9",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 781,
+ "y": 420,
+ "z": 866
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 13,
+ "name": "Lamp 10",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 898,
+ "y": 420,
+ "z": -2008
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 14,
+ "name": "Lamp 11",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 2065,
+ "y": 420,
+ "z": 1276
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 15,
+ "name": "Lamp 12",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -1737,
+ "y": 420,
+ "z": -372
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 16,
+ "name": "Lamp 13",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -1351,
+ "y": 420,
+ "z": 128
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 17,
+ "name": "Lamp 14",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 373,
+ "y": 420,
+ "z": -2126
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
+ },
+ {
+ "id": 18,
+ "name": "Lamp 15",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -433,
+ "y": 420,
+ "z": -419
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 0,
+ "color": {
+ "r": 1,
+ "g": 0.68,
+ "b": 0.36,
+ "a": 1
+ },
+ "intensity": 2.4,
+ "radius": 560,
+ "innerRadius": 40,
+ "falloff": 1.3,
+ "enabled": true
+ }
+ }
+ ]
}
]
}
\ No newline at end of file
diff --git a/examples/bistro/tools/build-scene.mjs b/examples/bistro/tools/build-scene.mjs
index 66bd99e33..329ac8db4 100644
--- a/examples/bistro/tools/build-scene.mjs
+++ b/examples/bistro/tools/build-scene.mjs
@@ -28,6 +28,9 @@ const aim = (d) => {
};
const tr = (position, rotation) => ({ type: 'Transform', data: { position, ...(rotation ? { rotation } : {}) } });
+/** The street lamps, as the source places them (centimetres): where the glass is. */
+const LAMPS = [[-2028, -712], [-1773, -1494], [-1194, -962], [-851, -1151], [-220, -1838], [-966, 206], [-209, 465], [-176, 1004], [781, 866], [898, -2008], [2065, 1276], [-1737, -372], [-1351, 128], [373, -2126], [-433, -419]];
+
const entities = [
{ id: 0, name: 'Camera', parent: null, children: [], visible: true, components: [
// The view Bistro's authors framed: the corner of the bistro, down the street.
@@ -35,21 +38,21 @@ const entities = [
{ type: 'Camera', data: { projectionType: 0, fov: 50, nearPlane: 10, farPlane: 30000, isActive: true, priority: 0 } },
{ type: 'PostProcessVolume', data: { isGlobal: true, priority: 0, weight: 1, effects: [
{ type: 'ssao', enabled: true, uniforms: { u_radius: 80, u_intensity: 1, u_bias: 0.12, u_power: 1.5 } },
- { type: 'bloom', enabled: true, uniforms: { u_threshold: 0.9, u_intensity: 0.8, u_radius: 1.3 } },
- { type: 'colorGrade', enabled: true, uniforms: { u_exposure: 0, u_contrast: 1.06, u_saturation: 1.08, u_temperature: 0.06, u_tint: 0 } },
- { type: 'tonemap', enabled: true, uniforms: { u_exposure: 0.1 } },
+ { type: 'bloom', enabled: true, uniforms: { u_threshold: 0.75, u_intensity: 1.1, u_radius: 1.5 } },
+ { type: 'colorGrade', enabled: true, uniforms: { u_exposure: 0.05, u_contrast: 1.1, u_saturation: 1.05, u_temperature: -0.04, u_tint: 0 } },
+ { type: 'tonemap', enabled: true, uniforms: { u_exposure: 0.15 } },
{ type: 'vignette', enabled: true, uniforms: { u_intensity: 0.35, u_softness: 0.6 } },
{ type: 'fxaa', enabled: true, uniforms: { u_intensity: 1 } },
] } },
] },
{ id: 1, name: 'Sun', parent: null, children: [], visible: true, components: [
tr({ x: 0, y: 0, z: 0 }, aim({ x: -0.4, y: -0.28, z: 0.87 })),
- { type: 'Light', data: { type: 1, color: { r: 1, g: 0.72, b: 0.46, a: 1 }, intensity: 1.9, enabled: true,
+ { type: 'Light', data: { type: 1, color: { r: 0.62, g: 0.68, b: 0.95, a: 1 }, intensity: 0.7, enabled: true,
meshShadows: true, shadowExtent: 2600, shadowStrength: 0.85, shadowSoftness: 0.3 } },
] },
{ id: 2, name: 'Sky', parent: null, children: [], visible: true, components: [
tr({ x: 0, y: 0, z: 0 }),
- { type: 'Light', data: { type: 2, color: { r: 1, g: 1, b: 1, a: 1 }, intensity: 0.8, enabled: true,
+ { type: 'Light', data: { type: 2, color: { r: 1, g: 1, b: 1, a: 1 }, intensity: 0.5, enabled: true,
environment: 'assets/env/the_sky_is_on_fire_2k.esenv', drawEnvironment: true } },
] },
// One centimetre of the source is one engine unit, which the import's own 0.016 turns back into 1/62.5.
@@ -57,5 +60,9 @@ const entities = [
{ prefabEntityId: 'n1', type: 'property', componentType: 'Transform', propertyName: 'scale', value: { x: 62.5, y: 62.5, z: 62.5 } },
], added: [], removed: [] },
];
+LAMPS.forEach(([x, z], i) => entities.push({ id: entities.length, name: `Lamp ${i + 1}`, parent: null, children: [], visible: true, components: [
+ tr({ x, y: 420, z }),
+ { type: 'Light', data: { type: 0, color: { r: 1, g: 0.68, b: 0.36, a: 1 }, intensity: 2.4, radius: 560, innerRadius: 40, falloff: 1.3, enabled: true } },
+] }));
writeFileSync(path.join(ROOT, 'assets/scenes/main.esscene'), JSON.stringify({ version: 4, name: 'Main', entities }, null, 2));
console.log('wrote scene');