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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(render): the WebGL2 Voxel GI takes what the sun lights from its shadow map and bounces light more than once, as the WebGPU one does
yhh6b42e9b34ebb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 834e18aa8..4cb8d615e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,7 +16,7 @@ published separately; it ships inside the editor.### Added-- **Voxel GI lights what the camera does not see, and bounces light more than once (WebGPU).** The cache now reads the sun's shadow map back into the world, so a surface the sun lights behind or beside the camera still sends light into the view. Each surface also gives off again the bounce light it received, so a corner or a floor in shade gets light that took two or more bounces to reach it. A ray now brings what it meets at full strength however far it went (it used to fade with distance, 40% at 4 m with 12 cm voxels). Each voxel is weighed by how much of it a surface covers, so a bright patch no longer lights like the whole voxel around it. Together these keep the result close to a path tracer's whatever the voxel size. In a sunlit test room the whole frame carries 0.95 of Cycles' light at the default size and 0.74 at 12 cm voxels; before, it was 0.54 at the default and darker the finer the grid. With the lit patch behind the camera, the walls went from no bounce light to 25–57%. A closed room the sun only lights from outside stays dark. Two inspector controls tune it: **Off-screen Sun Albedo** (the colour the shadow map cannot give, assumed) and **Multi-bounce**. A fine grid no longer drops every voxel: a count truncated by the cache's ageing had kept them below the two samples a ray asks for. The WebGL2 fallback still sees only the picture.+- **Voxel GI lights what the camera does not see, and bounces light more than once.** The cache now reads the sun's shadow map back into the world, so a surface the sun lights behind or beside the camera still sends light into the view. Each surface also gives off again the bounce light it received, so a corner or a floor in shade gets light that took two or more bounces to reach it. A ray now brings what it meets at full strength however far it went (it used to fade with distance, 40% at 4 m with 12 cm voxels). Each voxel is weighed by how much of it a surface covers, so a bright patch no longer lights like the whole voxel around it. Together these keep the result close to a path tracer's whatever the voxel size. In a sunlit test room the whole frame carries 0.95 of Cycles' light at the default size and 0.74 at 12 cm voxels; before, it was 0.54 at the default and darker the finer the grid. With the lit patch behind the camera, the walls went from no bounce light to 25–57%. A closed room the sun only lights from outside stays dark. Two inspector controls tune it: **Off-screen Sun Albedo** (the colour the shadow map cannot give, assumed) and **Multi-bounce**. A fine grid no longer drops every voxel: a count truncated by the cache's ageing had kept them below the two samples a ray asks for. The WebGL2 fallback does the same in its own passes: each voxel asks the sun's map whether a sunlit surface stands in it, and traces two rays through last frame's grid for the light it is given. In the test room it carries 1.00 of Cycles' light at the default size (it was 0.56) and 0.80 at 12 cm; with the lit patch behind the camera 0.20 (it was 0). Its voxel pass costs about 1.3 ms more at 720p on a desktop.- **A model of many parts that moves: `CompositeBatch`.** Put it on the root of a ship, a vehicle or a moving platform assembled from many meshes, and while the game runs its parts are drawn in a few draws parented to the root: a mesh repeated four times or more (a deck plank, a rail post) as one instanced set that copies no vertices, every other part merged by draw state into chunks of the root's own space. Moving, turning or scaling the root moves the whole model and merges nothing again. Adding, removing, re-meshing or re-placing a part re-merges only its chunk within half a second (`CompositeBatchingRes.refresh(root)` looks at once), and a part that keeps moving inside the model is let go to draw itself. The root reports what it drew, and so does `get_stats`. On a model of 2,004 parts, the meshes handed to the renderer went from 2,003 to 5 and the CPU frame from 3.3 ms to 1.2–1.4 ms; a model of about a hundred parts costs the same either way. A part under a composite is never also statically batched.diff --git a/sdk/src/postprocess/effects.ts b/sdk/src/postprocess/effects.tsindex a45c359df..ee5f023be 100644--- a/sdk/src/postprocess/effects.ts+++ b/sdk/src/postprocess/effects.ts@@ -481,10 +481,10 @@ registerEffect({// 1 shows the gathered light alone.{ name: 'u_debug', label: 'Show GI Only', min: 0, max: 1, step: 1, defaultValue: 0 },// What the sun lights off screen is read from its shadow map, which holds no colour: such a surface is lit as one of this albedo.- // 0 leaves the sun out, and the cache then knows only what the picture shows. WebGPU only.+ // 0 leaves the sun out, and the cache then knows only what the picture shows.{ name: 'u_sunAlbedo', label: 'Off-screen Sun Albedo', min: 0, max: 1, step: 0.01, defaultValue: 0.6 },// How much of the light a surface was bounced gives off again, which is what carries light past the first bounce (into a- // corner, onto a face only another lit face sees). 0 is one bounce. WebGPU only.+ // corner, onto a face only another lit face sees). 0 is one bounce.{ name: 'u_bounceFeedback', label: 'Multi-bounce', min: 0, max: 1, step: 0.01, defaultValue: 1 },],});diff --git a/sdk/src/postprocess/voxelGIFallback.ts b/sdk/src/postprocess/voxelGIFallback.tsindex f33174f2f..5994c7cbe 100644--- a/sdk/src/postprocess/voxelGIFallback.ts+++ b/sdk/src/postprocess/voxelGIFallback.ts@@ -54,6 +54,13 @@ export const voxelGIFallback = {#pragma param u_decay float default(0.93) range(0,0.99)#pragma param u_maxBounce float default(3) range(0.5,16)#pragma param u_feedback texture default(black)+#pragma param u_sceneAlbedo texture default(black) texel(data)+#pragma param u_intensity float default(1) range(0,4)+#pragma param u_range float default(48) range(4,90)+#pragma param u_bias float default(1.2) range(0,4)+#pragma param u_sunAlbedo float default(0.6) range(0,1)+#pragma param u_bounceFeedback float default(1) range(0,1)+#pragma lights#pragma fragmentprecision highp float;@@ -69,6 +76,99 @@ ${SSAO_GLSL}${GBUFFER_GLSL}${COMMON}+// How far toward the sun from p the surface the sun lights is, in world units, read from tile t of its map; ok false where the map does not+// cover p. The map stores clip z remapped to [0, 1], so the change of that number over one voxel toward the sun turns it into a distance.+float sunAlong(vec3 p, vec3 L, int t, float vs, out bool ok) {+ ok = false;+ mat4 m = u_shadowMatrix[t];+ vec4 a = m * vec4(p, 1.0);+ if (a.w <= 0.0) return 0.0;+ vec3 pa = a.xyz / a.w;+ vec2 uv = pa.xy * 0.5 + 0.5;+ if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return 0.0;+ vec4 b = m * vec4(p + L * vs, 1.0);+ float kz = (b.z / b.w - pa.z) * 0.5;+ if (abs(kz) < 1e-9) return 0.0;+ vec4 rect = u_shadowTile[t];+ float d = unpackDepth(texture(u_shadowMap, rect.xy + uv * rect.z).rgb);+ if (d >= 1.0 || d <= 0.0) return 0.0;+ ok = true;+ return (d - (pa.z * 0.5 + 0.5)) / kz * vs;+}++/// Whether the sun lights a surface inside the voxel at centre c, and if so its normal and the light it gives off as a surface of the+/// assumed albedo: the sun's map is the one record of what it reaches that does not depend on where the camera looks.+bool sunSurface(vec3 c, float vs, out vec3 nrm, out vec3 light) {+ nrm = vec3(0.0);+ light = vec3(0.0);+ if (u_sunAlbedo <= 0.0 || u_shadowParams.x < 0.5) return false;+ vec4 lightDir, lightColor;+ ivec2 tiles;+ findSun(lightDir, lightColor, tiles);+ if (lightDir.w < 0.5 || tiles.y <= 0) return false;+ vec3 L = normalize(lightDir.xyz);+ vec3 up = abs(L.y) < 0.99 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0);+ vec3 X = normalize(cross(up, L));+ vec3 Y = cross(L, X);+ for (int k = 0; k < 4; ++k) {+ if (k >= tiles.y) break;+ int t = tiles.x + k;+ bool ok;+ float along = sunAlong(c, L, t, vs, ok);+ if (!ok) continue;+ // The surface the sun meets along the ray through this voxel's centre is in this voxel, or it belongs to another. Measured along+ // a slanted ray, half a voxel is not enough: a floor on the boundary between two cells is more than half a voxel from either+ // centre along a sun that is not overhead, and neither took it.+ if (abs(along) > vs * 0.75) return false;+ vec3 s0 = c + L * along;+ bool okx, oky;+ float ax = sunAlong(c + X * (vs * 0.5), L, t, vs, okx);+ float ay = sunAlong(c + Y * (vs * 0.5), L, t, vs, oky);+ if (!okx || !oky) return false;+ vec3 sx = c + X * (vs * 0.5) + L * ax;+ vec3 sy = c + Y * (vs * 0.5) + L * ay;+ vec3 ex = sx - s0;+ vec3 ey = sy - s0;+ // A neighbour across a depth edge gives no plane.+ if (length(ex) > vs * 2.0 || length(ey) > vs * 2.0) return false;+ vec3 cr = cross(ex, ey);+ if (!(dot(cr, cr) > 1e-12)) return false;+ nrm = normalize(cr);+ if (dot(nrm, L) < 0.0) nrm = -nrm;+ light = clamp(lightColor.rgb * lightColor.a * (u_sunAlbedo * max(dot(nrm, L), 0.0)), vec3(0.0), vec3(u_maxBounce));+ return true;+ }+ return false;+}++/// The light a ray from origin along dir brings back from LAST frame's grid (u_feedback): what a voxel is lit by, which is what carries+/// light past the first bounce.+vec3 traceHeld(vec3 origin, vec3 dir, ivec3 heldWindow, float vs) {+ vec3 pos = origin / vs;+ ivec3 cell = ivec3(floor(pos));+ ivec3 stepv = ivec3(dir.x >= 0.0 ? 1 : -1, dir.y >= 0.0 ? 1 : -1, dir.z >= 0.0 ? 1 : -1);+ vec3 safe = vec3(abs(dir.x) < 1e-6 ? 1e-6 : dir.x, abs(dir.y) < 1e-6 ? 1e-6 : dir.y, abs(dir.z) < 1e-6 ? 1e-6 : dir.z);+ vec3 delta = abs(vec3(1.0) / safe);+ vec3 next = vec3(dir.x >= 0.0 ? float(cell.x + 1) : float(cell.x), dir.y >= 0.0 ? float(cell.y + 1) : float(cell.y), dir.z >= 0.0 ? float(cell.z + 1) : float(cell.z));+ vec3 tMax = (next - pos) / safe;+ float t = 0.0;+ for (int i = 0; i < 48; ++i) {+ if (t > u_range) break;+ if (tMax.x < tMax.y && tMax.x < tMax.z) { cell.x += stepv.x; t = tMax.x; tMax.x += delta.x; }+ else if (tMax.y < tMax.z) { cell.y += stepv.y; t = tMax.y; tMax.y += delta.y; }+ else { cell.z += stepv.z; t = tMax.z; tMax.z += delta.z; }+ ivec3 slot = cell - heldWindow;+ if (any(lessThan(slot, ivec3(0))) || any(greaterThanEqual(slot, DIMS))) break;+ vec4 a = texelFetch(u_feedback, slotTexel(slot, 0), 0);+ if (a.a < 2.0) continue;+ vec4 b = texelFetch(u_feedback, slotTexel(slot, 1), 0);+ vec3 facing = (b.xyz / max(b.w, 1.0)) * 2.0 - 1.0;+ if (dot(normalize(facing), dir) > -0.15) continue;+ return (a.rgb / a.a) * clamp((u_range - t) / (u_range * 0.15), 0.0, 1.0);+ }+ return vec3(0.0);+}+void main() {ivec2 t = ivec2(gl_FragCoord.xy);float vs = max(u_voxelSize, 1.0);@@ -93,49 +193,93 @@ void main() {vec3 centre = (vec3(cell) + 0.5) * vs;vec4 clip = u_projection * vec4(centre, 1.0);ivec2 size = textureSize(u_sceneDepth, 0);- if (clip.w <= 1e-3) { fragColor = held; return; }- vec2 ndc = clip.xy / clip.w;- if (abs(ndc.x) > 1.25 || abs(ndc.y) > 1.25) { fragColor = held; return; }- vec2 px = (ndc * 0.5 + 0.5) * vec2(size);- float radius = clamp(vs * 0.5 * abs(u_projection[1][1]) * 0.5 * float(size.y) / clip.w, 0.5, 48.0) * 1.15;-- // Five looks first: if the surfaces the screen shows around this voxel are all well in front of it or well behind it, it is- // empty air or hidden, and the rest of the work is skipped. Most voxels are.- bool near = false;- for (int k = 0; k < 5; ++k) {- vec2 o = k == 0 ? vec2(0.0) : (k == 1 ? vec2(radius, 0.0) : (k == 2 ? vec2(-radius, 0.0) : (k == 3 ? vec2(0.0, radius) : vec2(0.0, -radius))));- ivec2 tp = clamp(ivec2(px + o), ivec2(0), size - ivec2(1));- float d = depthAt(tp, size);- if (d >= 1.0) continue;- float w = (u_projection * vec4(worldAt(tp, size), 1.0)).w;- if (abs(w - clip.w) < vs * 3.0) { near = true; break; }- }- if (!near) { fragColor = held; return; }-- // Then the pixels in its footprint whose surface is inside it. The grid is jittered per voxel and per frame, so what the memory- // averages is the whole footprint and not one fixed pattern of it.- float frameSeed = floor(u_time.x * 30.0);- vec2 jit = vec2(hash1(vec3(cell) + frameSeed), hash1(vec3(cell.zxy) * 1.7 + frameSeed * 3.1)) - 0.5;vec3 sum = vec3(0.0);float count = 0.0;- for (int j = -2; j <= 2; ++j) {- for (int i = -2; i <= 2; ++i) {- ivec2 tp = ivec2(px + (vec2(float(i), float(j)) + jit * 0.9) * radius * 0.5);- if (tp.x < 0 || tp.y < 0 || tp.x >= size.x || tp.y >= size.y) continue;+ vec3 albedoSum = vec3(0.0);+ float albedoCount = 0.0;+ vec2 ndc = clip.xy / max(clip.w, 1e-3);+ bool onScreen = clip.w > 1e-3 && abs(ndc.x) <= 1.25 && abs(ndc.y) <= 1.25;+ if (onScreen) {+ vec2 px = (ndc * 0.5 + 0.5) * vec2(size);+ float radius = clamp(vs * 0.5 * abs(u_projection[1][1]) * 0.5 * float(size.y) / clip.w, 0.5, 48.0) * 1.15;++ // Five looks first: if the surfaces the screen shows around this voxel are all well in front of it or well behind it, it is+ // empty air or hidden, and the footprint is skipped. Most voxels are.+ bool near = false;+ for (int k = 0; k < 5; ++k) {+ vec2 o = k == 0 ? vec2(0.0) : (k == 1 ? vec2(radius, 0.0) : (k == 2 ? vec2(-radius, 0.0) : (k == 3 ? vec2(0.0, radius) : vec2(0.0, -radius))));+ ivec2 tp = clamp(ivec2(px + o), ivec2(0), size - ivec2(1));float d = depthAt(tp, size);if (d >= 1.0) continue;- vec3 world = worldAt(tp, size);- if (any(notEqual(ivec3(floor(world / vs)), cell))) continue;- if (region == 0) {- sum += clamp(texelFetch(u_texture, tp, 0).rgb, vec3(0.0), vec3(u_maxBounce));- } else {- Surface s = readSurface(tp);- if (!s.known) continue;- vec3 n = s.normal;- if (dot(n, viewDirection(world)) < 0.0) n = -n;- sum += n * 0.5 + 0.5;+ float w = (u_projection * vec4(worldAt(tp, size), 1.0)).w;+ if (abs(w - clip.w) < vs * 3.0) { near = true; break; }+ }+ if (near) {+ // Then the pixels in its footprint whose surface is inside it. The grid is jittered per voxel and per frame, so what the+ // memory averages is the whole footprint and not one fixed pattern of it.+ float frameSeed = floor(u_time.x * 30.0);+ vec2 jit = vec2(hash1(vec3(cell) + frameSeed), hash1(vec3(cell.zxy) * 1.7 + frameSeed * 3.1)) - 0.5;+ for (int j = -2; j <= 2; ++j) {+ for (int i = -2; i <= 2; ++i) {+ ivec2 tp = ivec2(px + (vec2(float(i), float(j)) + jit * 0.9) * radius * 0.5);+ if (tp.x < 0 || tp.y < 0 || tp.x >= size.x || tp.y >= size.y) continue;+ float d = depthAt(tp, size);+ if (d >= 1.0) continue;+ vec3 world = worldAt(tp, size);+ if (any(notEqual(ivec3(floor(world / vs)), cell))) continue;+ if (region == 0) {+ sum += clamp(texelFetch(u_texture, tp, 0).rgb, vec3(0.0), vec3(u_maxBounce));+ vec4 al = texelFetch(u_sceneAlbedo, min(tp, textureSize(u_sceneAlbedo, 0) - ivec2(1)), 0);+ if (al.a > 0.5) { albedoSum += al.rgb; albedoCount += 1.0; }+ } else {+ Surface s = readSurface(tp);+ if (!s.known) continue;+ vec3 n = s.normal;+ if (dot(n, viewDirection(world)) < 0.0) n = -n;+ sum += n * 0.5 + 0.5;+ }+ count += 1.0;+ }+ }+ }+ }++ // What the sun lights where the picture showed nothing of this voxel: off screen, or hidden behind something nearer.+ bool sunLit = false;+ if (count == 0.0) {+ vec3 sn, sl;+ if (sunSurface(centre, vs, sn, sl)) {+ sum = region == 0 ? sl : sn * 0.5 + 0.5;+ count = 1.0;+ sunLit = true;+ }+ }++ // The bounce: a surface gives off again what it is lit by, read from last frame's grid along a few rays around the way it faces. Each+ // frame carries light one surface further, so the grid converges on every bounce rather than on the first.+ if (region == 0 && count > 0.0 && u_bounceFeedback > 0.0 && abs(meta.w - vs) < 0.5) {+ // The window the last frame's grid was laid out in: this one, less how far it moved since (meta holds its origin mod 1024).+ ivec3 heldWindow = origin - ivec3(floor(mod(vec3(origin) - meta.xyz + 512.0, 1024.0) - 512.0 + 0.5));+ vec4 f = all(greaterThanEqual(was, ivec3(0))) && all(lessThan(was, DIMS)) ? texelFetch(u_feedback, slotTexel(was, 1), 0) : vec4(0.0);+ vec3 n = f.w > 0.5 ? normalize((f.xyz / f.w) * 2.0 - 1.0) : vec3(0.0);+ if (dot(n, n) > 0.5) {+ vec3 o = centre + n * (vs * u_bias);+ float seed = hash1(vec3(cell) * 0.37 + floor(u_time.x * 30.0));+ vec3 up = abs(n.y) < 0.99 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0);+ vec3 tx = normalize(cross(up, n));+ vec3 ty = cross(n, tx);+ vec3 incoming = vec3(0.0);+ for (int r = 0; r < 2; ++r) {+ float u = fract(seed + float(r) * 0.5);+ float v = fract(seed * 7.13 + float(r) * 0.618);+ float rr = sqrt(u);+ float phi = 6.2831853 * v;+ vec3 dir = normalize(tx * (rr * cos(phi)) + ty * (rr * sin(phi)) + n * sqrt(max(1.0 - u, 0.0)));+ incoming += traceHeld(o, dir, heldWindow, vs);}- count += 1.0;+ incoming *= 0.5;+ vec3 albedo = albedoCount > 0.0 ? albedoSum / albedoCount : vec3(sunLit ? u_sunAlbedo : 0.0);+ sum += clamp(albedo * incoming * (u_intensity * u_bounceFeedback), vec3(0.0), vec3(u_maxBounce)) * count;}}fragColor = held + vec4(sum, count);@@ -210,7 +354,8 @@ vec3 trace(vec3 origin, vec3 dir, ivec3 window, float vs) {vec3 facing = (b.xyz / max(b.w, 1.0)) * 2.0 - 1.0;// A surface is met from the side it faces. One facing away is behind the ray, or the ray skims along it.if (dot(normalize(facing), dir) > -0.15) continue;- return (a.rgb / a.a) * clamp(1.0 - t / u_range, 0.0, 1.0);+ // What a ray meets is what it brings, however far it went; only the last stretch of the range fades, so its edge draws no line.+ return (a.rgb / a.a) * clamp((u_range - t) / (u_range * 0.15), 0.0, 1.0);}return vec3(0.0);}diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 287200d98..b3ec3b741 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -3821,7 +3821,9 @@ export const NOTED = {"feat(render): the scene pass writes each surface's diffuse colour beside its normal, so Voxel GI and SSGI reflect bounce light by what it lands on instead of a grey guessed from the lit picture; render gates hold the baked and voxel-lit GI room":{"note":"Bounce light takes the colour of what it lands on."},"feat(render): Voxel GI on WebGPU reads the sun's shadow map back into its cache and feeds each bounce back, so light the camera does not see and light past the first bounce reach the picture":- {"note":"Voxel GI lights what the camera does not see, and bounces light more than once (WebGPU)."},+ {"note":"Voxel GI lights what the camera does not see, and bounces light more than once."},"fix(render): Voxel GI brings a bounce at full strength however far the ray went, and weighs each voxel by how much of it a surface covers, so a fine grid is no longer dim and a coarse one no longer brighter":- {"note":"Voxel GI lights what the camera does not see, and bounces light more than once (WebGPU)."},+ {"note":"Voxel GI lights what the camera does not see, and bounces light more than once."},+ "feat(render): the WebGL2 Voxel GI takes what the sun lights from its shadow map and bounces light more than once, as the WebGPU one does":+ {"note":"Voxel GI lights what the camera does not see, and bounces light more than once."},};diff --git a/tools/render-lab/README.md b/tools/render-lab/README.mdindex 2e573e738..2c25b6893 100644--- a/tools/render-lab/README.md+++ b/tools/render-lab/README.md@@ -97,3 +97,26 @@ GPU cost at 1280×720, WebGL2, on this desktop:The remaining under-shoot at 12 cm (about 25%) has no single cause found. Rays still escape through partly covered voxels and past the facing test.Trap: the first frame captured right after the hidden editor restarts can be a stale one (no GI). Step and capture again before you read anything.++### The WebGL2 fallback (2026-11-05)++The fallback has no compute stage, so it gets the same two things a different way, inside `gi_voxels`, where every atlas texel is one+voxel:++- **Sun.** The voxel's centre is projected into the sun's map (`#pragma lights`, `findSun`). The map's z (clip z × 0.5 + 0.5), taken+ over one voxel toward the sun, turns into a distance. A sunlit surface within 0.75 voxels of the centre, measured along the ray, is+ in the voxel; half a voxel missed a floor lying on a cell boundary. Its normal comes from the same test at two offsets. It is used+ only where the picture showed nothing of the voxel.+- **Bounce.** A voxel with content traces two rays through last frame's atlas (`u_feedback`) along its facing, and adds albedo × what+ they bring. The albedo is the footprint's mean from `u_sceneAlbedo`, or the sun's assumed albedo.++| Scene | Before | After |+| --- | --- | --- |+| `gi_room` at 40 cm | 0.56 | 1.00 (mean \|d\| 0.0078) |+| `gi_room` at 12 cm | — | 0.80 (two runs, the same) |+| `gi_away` at 12 cm | 0 | 0.20 |+| `gi_leak` | — | mean 0.006/255, max 10/255 |++The voxel pass went from 1.11 to 2.45 ms (frame 4.4 → 5.1 ms). There is no coverage term here (the atlas has no spare channel), so+coarse grids still overshoot regionally: the ceiling is 1.4 at 40 cm. One headless run of 12 cm read 0.51. A rerun twice read 0.80,+so take a single low reading as a capture timed before the grid filled.diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjsindex 5a6ee5cfa..75930910d 100644--- a/tools/renderScenes.mjs+++ b/tools/renderScenes.mjs@@ -165,9 +165,9 @@ export const SCENES = [// engine's, each within 4 of Cycles' own render of the same room (tools/render-lab, gi_room).{ id: "gi-room-baked", tier: "pr", webgpu: true, env: { "ESTELLA_VERIFY_COLORSPACE": "linear", "ESTELLA_VERIFY_SCENE": "/scenes/gi-room-baked.esscene", "ESTELLA_VERIFY_MANIFEST": "/scenes/gi-room-baked.textures.json", "ESTELLA_VERIFY_TEXTURES": "runtime", "ESTELLA_VERIFY_W": "320", "ESTELLA_VERIFY_H": "180", "ESTELLA_VERIFY_STEPS": "4", "ESTELLA_VERIFY_EXPECT": "[{\"x\":0.5,\"y\":0.099,\"rgb\":[66,63,60],\"tol\":10},{\"x\":0.239,\"y\":0.508,\"rgb\":[69,30,26],\"tol\":10},{\"x\":0.761,\"y\":0.508,\"rgb\":[23,46,21],\"tol\":10},{\"x\":0.441,\"y\":0.344,\"rgb\":[61,55,53],\"tol\":10},{\"x\":0.375,\"y\":0.711,\"rgb\":[64,54,51],\"tol\":10}]" } },// The same room unbaked, lit by Voxel GI: the bounce light on the red wall is red, because it is reflected by the albedo the wall wrote beside its- // normal. Before the albedo attachment it was guessed from the lit picture, and a wall the sun does not reach came out grey. WebGPU has its own- // numbers: its cache also takes the sun's shadow map and feeds each bounce back (several bounces), which the WebGL2 fallback does not.- { id: "gi-room-voxel", tier: "pr", webgpu: { "ESTELLA_VERIFY_EXPECT": "[{\"x\":0.5,\"y\":0.099,\"rgb\":[78,74,73],\"tol\":18},{\"x\":0.239,\"y\":0.508,\"rgb\":[74,36,31],\"tol\":18},{\"x\":0.761,\"y\":0.508,\"rgb\":[31,56,30],\"tol\":18}]" }, env: { "ESTELLA_VERIFY_PLAY": "1", "ESTELLA_VERIFY_COLORSPACE": "linear", "ESTELLA_VERIFY_SCENE": "/scenes/gi-room-voxel.esscene", "ESTELLA_VERIFY_MANIFEST": "/scenes/gi-room-voxel.textures.json", "ESTELLA_VERIFY_W": "320", "ESTELLA_VERIFY_H": "180", "ESTELLA_VERIFY_STEPS": "120", "ESTELLA_VERIFY_EXPECT": "[{\"x\":0.5,\"y\":0.099,\"rgb\":[58,58,58],\"tol\":16},{\"x\":0.239,\"y\":0.508,\"rgb\":[64,28,25],\"tol\":16},{\"x\":0.761,\"y\":0.508,\"rgb\":[18,41,20],\"tol\":16}]" } },+ // normal. Before the albedo attachment it was guessed from the lit picture, and a wall the sun does not reach came out grey. Both backends' caches+ // also take the sun's shadow map and feed each bounce back, and land within a few levels of each other.+ { id: "gi-room-voxel", tier: "pr", webgpu: true, env: { "ESTELLA_VERIFY_PLAY": "1", "ESTELLA_VERIFY_COLORSPACE": "linear", "ESTELLA_VERIFY_SCENE": "/scenes/gi-room-voxel.esscene", "ESTELLA_VERIFY_MANIFEST": "/scenes/gi-room-voxel.textures.json", "ESTELLA_VERIFY_W": "320", "ESTELLA_VERIFY_H": "180", "ESTELLA_VERIFY_STEPS": "120", "ESTELLA_VERIFY_EXPECT": "[{\"x\":0.5,\"y\":0.099,\"rgb\":[81,77,76],\"tol\":18},{\"x\":0.239,\"y\":0.508,\"rgb\":[77,35,30],\"tol\":18},{\"x\":0.761,\"y\":0.508,\"rgb\":[30,55,28],\"tol\":18}]" } },{ id: "lightmap-model", tier: "pr", webgpu: true, env: { "ESTELLA_VERIFY_MESH_MATERIAL": "/scenes/lightmap-model/rough.esmaterial", "ESTELLA_VERIFY_SCENE": "/scenes/lightmap-model.esscene", "ESTELLA_VERIFY_MANIFEST": "/scenes/lightmap-model.textures.json", "ESTELLA_VERIFY_W": "256", "ESTELLA_VERIFY_H": "256", "ESTELLA_VERIFY_STEPS": "2", "ESTELLA_VERIFY_EXPECT": "[{\"x\":0.25,\"y\":0.4,\"rgb\":[0,255,255],\"tol\":20},{\"x\":0.25,\"y\":0.6,\"rgb\":[128,255,0],\"tol\":20},{\"x\":0.75,\"y\":0.4,\"rgb\":[29,255,61],\"tol\":20},{\"x\":0.75,\"y\":0.6,\"rgb\":[29,255,61],\"tol\":20}]" } },// Why the rectangle rides the per-object record: ONE mesh and ONE atlas, and// the two objects drawn from them read different halves of it. A rectangle