@tinypoly/gpu-renderer 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +81 -10
- package/README.md +53 -5
- package/dist/atmosphere.d.ts +21 -0
- package/dist/atmosphere.d.ts.map +1 -0
- package/dist/atmosphere.js +72 -0
- package/dist/atmosphere.js.map +1 -0
- package/dist/bvh.d.ts +11 -6
- package/dist/bvh.d.ts.map +1 -1
- package/dist/bvh.js +64 -11
- package/dist/bvh.js.map +1 -1
- package/dist/denoise.d.ts +17 -2
- package/dist/denoise.d.ts.map +1 -1
- package/dist/denoise.js +95 -27
- package/dist/denoise.js.map +1 -1
- package/dist/dispatchScheduler.d.ts +11 -4
- package/dist/dispatchScheduler.d.ts.map +1 -1
- package/dist/dispatchScheduler.js +14 -7
- package/dist/dispatchScheduler.js.map +1 -1
- package/dist/frameLayout.d.ts.map +1 -1
- package/dist/frameLayout.js +18 -0
- package/dist/frameLayout.js.map +1 -1
- package/dist/geometry.d.ts.map +1 -1
- package/dist/geometry.js +6 -3
- package/dist/geometry.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lensPass.d.ts +60 -0
- package/dist/lensPass.d.ts.map +1 -0
- package/dist/lensPass.js +235 -0
- package/dist/lensPass.js.map +1 -0
- package/dist/lightTree.d.ts +43 -0
- package/dist/lightTree.d.ts.map +1 -0
- package/dist/lightTree.js +107 -0
- package/dist/lightTree.js.map +1 -0
- package/dist/lights.d.ts +19 -1
- package/dist/lights.d.ts.map +1 -1
- package/dist/lights.js +63 -1
- package/dist/lights.js.map +1 -1
- package/dist/materialLayout.d.ts +24 -0
- package/dist/materialLayout.d.ts.map +1 -1
- package/dist/materialLayout.js +36 -1
- package/dist/materialLayout.js.map +1 -1
- package/dist/pathTracePass.d.ts +6 -3
- package/dist/pathTracePass.d.ts.map +1 -1
- package/dist/pathTracePass.js +16 -10
- package/dist/pathTracePass.js.map +1 -1
- package/dist/renderer.d.ts +19 -7
- package/dist/renderer.d.ts.map +1 -1
- package/dist/renderer.js +198 -36
- package/dist/renderer.js.map +1 -1
- package/dist/sceneUpload.d.ts +19 -1
- package/dist/sceneUpload.d.ts.map +1 -1
- package/dist/sceneUpload.js +25 -3
- package/dist/sceneUpload.js.map +1 -1
- package/dist/settings.d.ts +136 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +100 -0
- package/dist/settings.js.map +1 -0
- package/dist/subsurface.d.ts +76 -0
- package/dist/subsurface.d.ts.map +1 -0
- package/dist/subsurface.js +70 -0
- package/dist/subsurface.js.map +1 -0
- package/dist/texturePack.d.ts +16 -4
- package/dist/texturePack.d.ts.map +1 -1
- package/dist/texturePack.js +61 -8
- package/dist/texturePack.js.map +1 -1
- package/dist/volumeContainment.d.ts +17 -0
- package/dist/volumeContainment.d.ts.map +1 -0
- package/dist/volumeContainment.js +61 -0
- package/dist/volumeContainment.js.map +1 -0
- package/dist/wgsl/bsdf.wgsl.d.ts +1 -1
- package/dist/wgsl/bsdf.wgsl.d.ts.map +1 -1
- package/dist/wgsl/bsdf.wgsl.js +35 -3
- package/dist/wgsl/bsdf.wgsl.js.map +1 -1
- package/dist/wgsl/bvh.wgsl.d.ts +8 -2
- package/dist/wgsl/bvh.wgsl.d.ts.map +1 -1
- package/dist/wgsl/bvh.wgsl.js +167 -96
- package/dist/wgsl/bvh.wgsl.js.map +1 -1
- package/dist/wgsl/common.wgsl.d.ts.map +1 -1
- package/dist/wgsl/common.wgsl.js +24 -7
- package/dist/wgsl/common.wgsl.js.map +1 -1
- package/dist/wgsl/lens.wgsl.d.ts +17 -0
- package/dist/wgsl/lens.wgsl.d.ts.map +1 -0
- package/dist/wgsl/lens.wgsl.js +315 -0
- package/dist/wgsl/lens.wgsl.js.map +1 -0
- package/dist/wgsl/lights.wgsl.d.ts +1 -1
- package/dist/wgsl/lights.wgsl.d.ts.map +1 -1
- package/dist/wgsl/lights.wgsl.js +206 -33
- package/dist/wgsl/lights.wgsl.js.map +1 -1
- package/dist/wgsl/pathTrace.wgsl.d.ts +1 -1
- package/dist/wgsl/pathTrace.wgsl.d.ts.map +1 -1
- package/dist/wgsl/pathTrace.wgsl.js +410 -25
- package/dist/wgsl/pathTrace.wgsl.js.map +1 -1
- package/dist/wgsl/random.wgsl.d.ts +1 -1
- package/dist/wgsl/random.wgsl.d.ts.map +1 -1
- package/dist/wgsl/random.wgsl.js +9 -17
- package/dist/wgsl/random.wgsl.js.map +1 -1
- package/dist/wgsl/sampling.wgsl.d.ts +1 -1
- package/dist/wgsl/sampling.wgsl.d.ts.map +1 -1
- package/dist/wgsl/sampling.wgsl.js +25 -0
- package/dist/wgsl/sampling.wgsl.js.map +1 -1
- package/dist/wgsl/surface.wgsl.d.ts +1 -1
- package/dist/wgsl/surface.wgsl.d.ts.map +1 -1
- package/dist/wgsl/surface.wgsl.js +47 -4
- package/dist/wgsl/surface.wgsl.js.map +1 -1
- package/dist/wgsl/texture.wgsl.d.ts +1 -1
- package/dist/wgsl/texture.wgsl.d.ts.map +1 -1
- package/dist/wgsl/texture.wgsl.js +10 -11
- package/dist/wgsl/texture.wgsl.js.map +1 -1
- package/package.json +1 -1
- package/src/atmosphere.ts +95 -0
- package/src/bvh.ts +81 -12
- package/src/denoise.ts +110 -27
- package/src/dispatchScheduler.ts +16 -7
- package/src/frameLayout.ts +18 -0
- package/src/geometry.ts +6 -2
- package/src/index.ts +13 -0
- package/src/lensPass.ts +299 -0
- package/src/lightTree.ts +172 -0
- package/src/lights.ts +90 -2
- package/src/materialLayout.ts +52 -1
- package/src/pathTracePass.ts +19 -10
- package/src/renderer.ts +258 -43
- package/src/sceneUpload.ts +41 -4
- package/src/settings.ts +234 -0
- package/src/subsurface.ts +153 -0
- package/src/texturePack.ts +80 -13
- package/src/volumeContainment.ts +81 -0
- package/src/wgsl/bsdf.wgsl.ts +35 -3
- package/src/wgsl/bvh.wgsl.ts +167 -96
- package/src/wgsl/common.wgsl.ts +24 -7
- package/src/wgsl/lens.wgsl.ts +314 -0
- package/src/wgsl/lights.wgsl.ts +206 -33
- package/src/wgsl/pathTrace.wgsl.ts +410 -25
- package/src/wgsl/random.wgsl.ts +9 -17
- package/src/wgsl/sampling.wgsl.ts +25 -0
- package/src/wgsl/surface.wgsl.ts +47 -4
- package/src/wgsl/texture.wgsl.ts +10 -11
package/ARCHITECTURE.md
CHANGED
|
@@ -27,7 +27,8 @@ stay the algorithmic reference, line by line.
|
|
|
27
27
|
|
|
28
28
|
- `device.ts`: adapter and device acquisition, requested limits, loss handling.
|
|
29
29
|
- `camera.ts`: the camera's matrices. Every ray goes through the inverse of the camera's own projection.
|
|
30
|
-
- `geometry.ts`, `bvh.ts`: flat triangle and attribute buffers, and the BVH built
|
|
30
|
+
- `geometry.ts`, `bvh.ts`: flat triangle and attribute buffers, and the BVH: built as a binary tree, then laid out in
|
|
31
|
+
64 byte nodes that each hold their two children's boxes, so one read tests both and a leaf is never read. Packing
|
|
31
32
|
also builds what Three draws in screen space (points, lines, sprites, dashes) as triangles facing the camera, applies
|
|
32
33
|
displacement maps, and runs vertex shaders. A plain mesh, with no vertex shader and no displacement, takes a faster
|
|
33
34
|
path that transforms each vertex once into typed arrays and writes exactly what the general one would.
|
|
@@ -58,8 +59,10 @@ falling off a cliff when a lobe is added.
|
|
|
58
59
|
|
|
59
60
|
**Arrays of the same kind share a binding.** A WebGPU device only has to offer eight storage buffers per shader stage,
|
|
60
61
|
and the kernel wants eleven arrays. Normals and the UV sets go in one buffer, the per-triangle material indices and the
|
|
61
|
-
hierarchy's triangle order in another, and the texture table
|
|
62
|
-
saying where each second half begins.
|
|
62
|
+
hierarchy's triangle order (both ways) in another, and the lookup tables and the texture table sit in front of the
|
|
63
|
+
texels they point at, with the uniform saying where each second half begins. The positions are uploaded in the
|
|
64
|
+
hierarchy's leaf order, so a leaf is one run of the buffer; anything that reads a triangle by its own number goes through
|
|
65
|
+
the inverse order. Positions, materials, nodes, lights and the accumulation buffer keep their own.
|
|
63
66
|
Merging costs a scene some headroom against `maxStorageBufferBindingSize`, which is why positions stay separate: they are
|
|
64
67
|
the largest array and the hottest one.
|
|
65
68
|
|
|
@@ -110,7 +113,8 @@ variance; after 32 paths, a pixel whose standard error (over the square root of
|
|
|
110
113
|
error is once encoded) is under half an 8 bit step stops, provided its 3 x 3 neighbourhood has too. The neighbourhood is
|
|
111
114
|
what keeps a rare bright path honest: a pixel judged alone would stop where it happened not to have seen one yet, and
|
|
112
115
|
that area would converge too dark. Each traced row sets a flag, read back after the pass, and the next pass dispatches
|
|
113
|
-
only the rows that still have work, until the budget is spent or a pixel reaches four times its share.
|
|
116
|
+
only the rows that still have work, until the budget is spent or a pixel reaches four times its share. Before 32 paths
|
|
117
|
+
no pixel can stop, so those passes take up to four paths a dispatch and read and write the accumulation once for them. Stopping on the
|
|
114
118
|
samples themselves is a slight bias, the usual price of adaptive sampling.
|
|
115
119
|
|
|
116
120
|
**The denoiser is the spatial filter of SVGF, with diffuse and specular light apart.** The temporal half of SVGF, and of
|
|
@@ -137,9 +141,71 @@ is a perfect history. What carries over from NRD's RELAX and REBLUR is splitting
|
|
|
137
141
|
times that: a converged pixel keeps exactly what was traced. `DenoiserSettings` scales the mix, the reach, the
|
|
138
142
|
luminance tolerance and the anti-firefly; changing it filters the finished accumulation again, without tracing.
|
|
139
143
|
|
|
140
|
-
It runs in its own pipelines, outside the kernel's eight storage buffers, on the canvas
|
|
141
|
-
|
|
142
|
-
|
|
144
|
+
It runs in its own pipelines, outside the kernel's eight storage buffers, on the canvas a few times a second while a
|
|
145
|
+
frame traces (at the end of a pass, at most every 200 ms) and on the image `render()` resolves with. The accumulation
|
|
146
|
+
holds six vec4 per pixel for all of this, 96 bytes, and the filter six more buffers of 16 and one of 4, the last two
|
|
147
|
+
the guides each tap compares, worked out once per pixel: a 2000 x 1350 image takes some 530 MB on the device.
|
|
148
|
+
|
|
149
|
+
**Light inside materials and volumes is a walk, compiled in only where a scene has it.** Both are media the path
|
|
150
|
+
crosses instead of surfaces it bounces off, and both are written into the bounce loop rather than as loops of their
|
|
151
|
+
own, so the one traversal call in the loop serves them.
|
|
152
|
+
|
|
153
|
+
- **Subsurface scattering** is a random walk, as in Cycles. A vertex on such a material takes the walk instead of its
|
|
154
|
+
surface lobes by chance, in proportion to the light each accounts for, so neither is weighted against the other; the
|
|
155
|
+
lobes it keeps lose that share of the diffuse layer. Inside, each colour has its own mean free path (`radius`) and the
|
|
156
|
+
single scattering albedo that the material's colour asks for (van de Hulst's relation, inverted); distances are drawn
|
|
157
|
+
for a colour picked by what the path still carries of it and weighed over all three (spectral MIS). Where the walk
|
|
158
|
+
reaches a surface it leaves through a white Lambert surface facing out, which takes direct light there.
|
|
159
|
+
- **Volumes** are homogeneous media bounded by an invisible mesh. A medium of one grey density lets the distance be
|
|
160
|
+
drawn after the segment is traced: the next hit is found, then a collision before it is drawn, and either way the
|
|
161
|
+
weight is one. A collision is a vertex whose lobe is the phase function (Henyey-Greenstein), with light sampled from
|
|
162
|
+
there. Shadow rays fade through every boundary they cross, and through the volume they start in; a light that casts no
|
|
163
|
+
shadow still fades, since the medium is not geometry. Whether the camera stands inside one is found on the CPU, by the
|
|
164
|
+
parity of a ray's crossings, once per frame.
|
|
165
|
+
- `SUBSURFACE_WALK` and `VOLUMES` are WGSL constants the pipeline is compiled with, true only for a scene with such a
|
|
166
|
+
material. Carrying the walk's code in every scene measured 2 to 5 percent slower on scenes that never run it (see
|
|
167
|
+
the next decision); folded away, a plain scene renders the same image as before, byte for byte.
|
|
168
|
+
- The snapshot has no field for either medium, so `serializeLive` marks the material's name while the CPU renderer
|
|
169
|
+
serializes it, as it already renames a shader material's type, and attaches the medium after. A snapshot built
|
|
170
|
+
elsewhere can carry `subsurface` or `volume` on its materials itself.
|
|
171
|
+
|
|
172
|
+
**The lens and the sensor are a pass of their own, after the radiance.** Bloom (Jimenez's 13 tap pyramid, folded
|
|
173
|
+
back with a tent), the aperture's rays (gathered along each ray from a quarter sized level), lateral chromatic
|
|
174
|
+
aberration and the white balance (a von Kries scaling in Bradford's cone space, exactly the identity at 6500 K) work on
|
|
175
|
+
linear light between the denoiser and the display transform, into a buffer the presentation and the image resolve read
|
|
176
|
+
in its place. Bloom and rays only move light, with weights that sum to one, so a flat image keeps its mean. Aerial
|
|
177
|
+
perspective is not part of it: it needs each sample's distance, so the kernel lays it over the camera's first surface,
|
|
178
|
+
as it lays Three's fog, with the extinction Koschmieder's law gives each colour and the glow of the surroundings and of
|
|
179
|
+
the brightest directional light scattered by the air's phase function. Lens distortion bends the camera rays, so it
|
|
180
|
+
needs no resampling.
|
|
181
|
+
|
|
182
|
+
**Lights are picked through a tree, by what they can deliver to the shaded point.** Picking by power alone sends a
|
|
183
|
+
small lamp beside a surface as few samples as its power earns against a large panel across the room, and its light
|
|
184
|
+
then arrives through bounce rays as fireflies. The lights that sit in the scene (emissive triangles, point, spot and
|
|
185
|
+
rectangular lights) lead the light buffer and are bound by a tree built on the CPU (`lightTree.ts`): each node keeps
|
|
186
|
+
its box, its power and a cone of the directions its lights face, and the kernel walks down choosing a child by its
|
|
187
|
+
importance from the point, power over squared distance times how well the cone and the receiving normal face each other,
|
|
188
|
+
widened by the angle the box takes (Conty Estevez and Kulla, 2018, without the splitting). The same walk, taken up from
|
|
189
|
+
a leaf, gives the chance a bounce ray's light was picked from the vertex it left, so the heuristic stays exact. The
|
|
190
|
+
directional lights and the environment follow, picked as before by the irradiance they deliver; the share between the
|
|
191
|
+
two groups is what the old distribution gave them. The nodes live in the texture buffer's extra words, sixteen a node,
|
|
192
|
+
because the kernel's eight storage bindings are taken.
|
|
193
|
+
|
|
194
|
+
**Bevel rounds edges at shading time, by one probe a sample.** As Cycles' bevel node, but stochastic: a point on a disk
|
|
195
|
+
of the radius around the shaded point, across an axis picked along the normal half the time and each tangent a
|
|
196
|
+
quarter, and a short ray along it that finds the same material there. Its normal turns the shading normal by as much
|
|
197
|
+
as it differs from the normal here, which keeps a normal map, and the pixel's samples average the turn into a rounded
|
|
198
|
+
edge. It costs a traversal a vertex on such materials, so `BEVEL` is compiled in only for a scene that has one.
|
|
199
|
+
|
|
200
|
+
**The kernel is bound by its size, not by its arithmetic.** Measured on an Apple GPU (`scripts/bench.html`, every
|
|
201
|
+
build timed in turns against the other), the nodes that hold their children's boxes made whole renders 16 to 21 percent
|
|
202
|
+
faster, but only once the traversal loop tested leaves in one place: with the leaf test written out wherever a leaf
|
|
203
|
+
turned up, three times a traversal, the same layout was slower than the binary tree it replaced. Replacing the sampler's
|
|
204
|
+
bit loop and the sRGB powers with tables gained only 3 to 5 percent. Every function call is inlined, so a traversal, a
|
|
205
|
+
light sample or a shader is copied wherever it is called, and what each copy costs in registers is paid across the whole
|
|
206
|
+
kernel. Fewer copies are not automatically better either: folding the closest and any hit searches into one call, or
|
|
207
|
+
calling the direct light from one place, measured slower. Measure a kernel change; do not judge it by the work it seems
|
|
208
|
+
to remove.
|
|
143
209
|
|
|
144
210
|
## Compatibility
|
|
145
211
|
|
|
@@ -241,7 +307,7 @@ it over one pixel.
|
|
|
241
307
|
| `SpotLight` | Cone and penumbra as Three computes them, and its projected `map` |
|
|
242
308
|
| `RectAreaLight` | A real area light, sampled over its rectangle, so its penumbra is traced rather than approximated |
|
|
243
309
|
| `AmbientLight`, `HemisphereLight` | See the divergence below |
|
|
244
|
-
| Emissive geometry | Any triangle whose material emits,
|
|
310
|
+
| Emissive geometry | Any triangle whose material emits, picked through the light tree by what it delivers to the shaded point |
|
|
245
311
|
|
|
246
312
|
`light.castShadow` gates the occlusion ray, as does `settings.shadows.enabled`. A `RectAreaLight` always occludes,
|
|
247
313
|
because Three has no shadow switch for one and an area light that cast none would look broken once traced. A toon
|
|
@@ -271,7 +337,10 @@ covers every surface instead.
|
|
|
271
337
|
|
|
272
338
|
Read: `samples`, `renderScale`, `exposure`, `toneMapping`, `vignette`, `grain`, `background`, `fog`, `depthOfField`
|
|
273
339
|
(the CPU renderer's 35 mm lens, `focusDistance`, `aperture` as an f-number, `blades` for polygonal bokeh),
|
|
274
|
-
`globalIllumination.bounces`, `globalIllumination.clamp`, `shadows.enabled`, `shadows.softness
|
|
340
|
+
`globalIllumination.bounces`, `globalIllumination.clamp`, `shadows.enabled`, `shadows.softness`, and the groups only this
|
|
341
|
+
renderer has: `globalIllumination.russianRoulette` and `rouletteStart`, `bloom`, `glare`, `lens`, `camera`,
|
|
342
|
+
`atmosphere`, `subsurface` and `volumes`. Its defaults differ from the CPU renderer's in `toneMapping` (AgX),
|
|
343
|
+
`globalIllumination.bounces` (12) and `globalIllumination.clamp` (10).
|
|
275
344
|
|
|
276
345
|
Ignored: `tileSize`, `ambientOcclusion`, and everything else under `globalIllumination` (`enabled`, `samples`,
|
|
277
346
|
`intensity`, `cache`, `cacheSpacing`, `denoise`).
|
|
@@ -307,7 +376,9 @@ Ignored: `tileSize`, `ambientOcclusion`, and everything else under `globalIllumi
|
|
|
307
376
|
- **Transparency is stochastic.** A surface with an opacity below one lets that share of rays straight through, which is
|
|
308
377
|
what makes a cutout cast a cutout shadow, and what makes the result converge rather than composite.
|
|
309
378
|
- **Unlit surfaces emit.** A basic material, a shader material, a sprite: whatever colour Three would draw, the surface
|
|
310
|
-
radiates, so it also lights its surroundings
|
|
379
|
+
radiates, so it also lights its surroundings. An opaque `MeshBasicMaterial` of a fixed colour (normal blending, no
|
|
380
|
+
alpha, light or environment map) is aimed at as a light, its colour times its map and vertex colours read at the
|
|
381
|
+
sampled point; anything else unlit is only found by bounce rays, since what it shows is not known until it runs.
|
|
311
382
|
- Global illumination is always on. There is no flag for it: tracing paths is what this renderer does.
|
|
312
383
|
- **Glass refracts** where Three's transmission samples a blurred copy of the opaque scene behind it. A volume bends what
|
|
313
384
|
is behind it and reflects its surroundings properly; a thin wall is exact. Neither is what Three draws.
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ It is the GPU sibling of [@tinypoly/cpu-renderer](https://github.com/tinypoly/cp
|
|
|
18
18
|
- Perspective and orthographic cameras, any projection Three builds; meshes, lines (`Line`, `LineSegments`, `LineLoop`), dashed lines, fat lines (`Line2`), sprites and `PointsMaterial`.
|
|
19
19
|
- Your custom `ShaderMaterial` GLSL, `RawShaderMaterial` and `onBeforeCompile` hooks: fragment shaders are translated to WGSL by [naga](https://github.com/gfx-rs/wgpu/tree/trunk/naga) and run in the kernel, with real derivatives; vertex shaders run on the CPU renderer's interpreter.
|
|
20
20
|
- HDR, gradient or procedural sky environments, light probes, depth of field with polygonal bokeh, fog, volumetric lights, vignette and grain, and ACES, AgX or Neutral tone mapping.
|
|
21
|
+
- What a photograph adds, on by default: subsurface scattering, volumes of fog and smoke, aerial perspective, a lens's bloom, aperture rays, chromatic aberration and distortion, a camera's white balance and exposure triangle.
|
|
21
22
|
- Adaptive sampling: pixels whose noise is gone stop taking paths, and the work they leave goes to the dark, glossy and out of focus areas that still need it.
|
|
22
23
|
- A variance-guided denoiser (the spatial filter of SVGF, with diffuse and specular light filtered apart as NVIDIA's RELAX does): each signal is separated from its albedo, filtered by an edge-avoiding wavelet that stops at normals, depths and roughness and trusts each pixel as far as its own variance says, and multiplied back, so textures stay sharp, a sharp reflection stays sharp and flat areas keep their exact mean.
|
|
23
24
|
- Progressive output: the canvas refines sample by sample, and the render can be paused, resumed and cancelled.
|
|
@@ -152,20 +153,23 @@ The renderer never falls back on its own. Choosing another renderer when WebGPU
|
|
|
152
153
|
|
|
153
154
|
### Settings
|
|
154
155
|
|
|
155
|
-
`RenderSettings`, grouped by feature, the CPU renderer
|
|
156
|
+
`GpuRenderSettings`: the CPU renderer's `RenderSettings`, grouped by feature, with the [groups only this renderer reads](#what-a-photograph-adds) beside them in the same object, which the CPU renderer leaves alone. Defaults are `DEFAULT_GPU_RENDER_SETTINGS`, the CPU renderer's own with what a photograph has turned on; `mergeGpuSettings(base, input)` applies a partial `GpuRenderSettingsInput` the way `setSettings` does. A path tracer reads some of the shared ones differently:
|
|
156
157
|
|
|
157
158
|
| Field | Default | |
|
|
158
159
|
| --- | --- | --- |
|
|
159
160
|
| `renderScale` | `1` | Multiplier on the image size. |
|
|
160
161
|
| `samples` | `4` | **Paths per pixel**, on average: one number does the antialiasing and the global illumination in a path tracer, and a few hundred is a clean image. Above 32, a pixel that has converged stops early and the noisiest ones take up to four times as many. |
|
|
161
|
-
| `toneMapping` | `"
|
|
162
|
+
| `toneMapping` | `"agx"` | `"aces"`, `"agx"`, `"neutral"` or `"linear"`. AgX rolls highlights off as film does; the CPU renderer defaults to ACES. |
|
|
162
163
|
| `exposure` | `1` | |
|
|
163
164
|
| `background.mode` | `"environment"` | `"environment"`, `"color"` or `"transparent"`, which makes the image's alpha the coverage of every pixel. |
|
|
164
165
|
| `background.color` | `"#1a1a1a"` | Used by `mode: "color"`. |
|
|
165
166
|
| `shadows.enabled` | `true` | Whether Three's lights are occlusion tested. Emissive geometry always is. |
|
|
166
167
|
| `shadows.softness` | `1` | Angular diameter of the lights in degrees. `0` gives hard shadows. |
|
|
167
|
-
| `globalIllumination.bounces` | `
|
|
168
|
-
| `globalIllumination.clamp` | `
|
|
168
|
+
| `globalIllumination.bounces` | `12` | How far a path goes: enough for light to fill a room. The roulette below keeps it affordable. |
|
|
169
|
+
| `globalIllumination.clamp` | `10` | Maximum luminance one indirect contribution may add, which trades a little bias for fewer fireflies, as Cycles' indirect light clamp does. `0` disables clamping. |
|
|
170
|
+
| `globalIllumination.russianRoulette` | `true` | Ends a path that carries little light by chance, weighting the survivors up so the mean stays exact. |
|
|
171
|
+
| `globalIllumination.rouletteStart` | `3` | Bounces every path takes before the roulette may end it. |
|
|
172
|
+
| `globalIllumination.lightTree` | `true` | Picks the light to aim at by what it delivers to the shaded point (power, distance, facing) through a tree over the scene's lights, rather than by power alone: a small lamp near a surface gets the samples it needs. |
|
|
169
173
|
| `depthOfField.enabled` | `false` | |
|
|
170
174
|
| `depthOfField.focusDistance` | `10` | World units. |
|
|
171
175
|
| `depthOfField.aperture` | `2.8` | f-number. |
|
|
@@ -176,7 +180,37 @@ The renderer never falls back on its own. Choosing another renderer when WebGPU
|
|
|
176
180
|
| `vignette` | `0` | `0` to `1`. |
|
|
177
181
|
| `grain` | `0` | `0` to `1`. |
|
|
178
182
|
|
|
179
|
-
|
|
183
|
+
#### What a photograph adds
|
|
184
|
+
|
|
185
|
+
Groups only this renderer reads, all on by default except the physical exposure, which needs a scene lit in physical units. Changing the lens, the camera's white balance or exposure, the bloom or the glare shows the finished image again without tracing it.
|
|
186
|
+
|
|
187
|
+
| Field | Default | |
|
|
188
|
+
| --- | --- | --- |
|
|
189
|
+
| `bloom.enabled` | `true` | The halo a lens and sensor scatter around bright light. Energy conserving and without a threshold: it only shows where something is far brighter than its surroundings. |
|
|
190
|
+
| `bloom.intensity` | `0.04` | Share of the light the halo takes, `0` to `1`. |
|
|
191
|
+
| `bloom.radius` | `0.65` | How far it reaches, `0` to `1`. |
|
|
192
|
+
| `glare.enabled` | `true` | The rays a bright light throws through the aperture's blades. Energy conserving like the bloom. |
|
|
193
|
+
| `glare.intensity` | `0.06` | Share of the light the rays take, `0` to `1`. |
|
|
194
|
+
| `glare.blades` | `6` | Blades of the aperture: an even count makes as many rays, an odd count twice as many. |
|
|
195
|
+
| `glare.length`, `glare.rotation` | `0.25`, `15` | How far the rays reach, as a share of the half diagonal, and the aperture's turn in degrees. |
|
|
196
|
+
| `lens.chromaticAberration` | `0.2` | Lateral colour fringes towards the corners, `0` to `1`. |
|
|
197
|
+
| `lens.distortion` | `0` | Radial distortion of the camera rays: positive is barrel, negative pincushion. |
|
|
198
|
+
| `camera.whiteBalance` | `6500` | Kelvin the camera takes as white; `6500` is neutral, lower cools the image. |
|
|
199
|
+
| `camera.physicalExposure` | `false` | Exposes from `iso`, `shutterSpeed` and `depthOfField.aperture`, with `exposure` as compensation. |
|
|
200
|
+
| `camera.iso`, `camera.shutterSpeed` | `100`, `1/125` | Seconds for the shutter. |
|
|
201
|
+
| `atmosphere.enabled` | `true` | Aerial perspective: the air fades distant surfaces towards the light it scatters, from the surroundings and the brightest directional light. Scenes in metres. |
|
|
202
|
+
| `atmosphere.visibility` | `20000` | Scene units at which a dark object keeps 2 percent contrast (Koschmieder): 20 km is a clear day. |
|
|
203
|
+
| `atmosphere.haze` | `0.6` | `0` clean air, blue (Rayleigh); `1` haze, grey and bright towards the sun (Mie). |
|
|
204
|
+
| `atmosphere.color` | `""` | The air's glow as `#rrggbb`; empty takes the surroundings' average. |
|
|
205
|
+
| `subsurface.enabled` | `true` | Materials with a [`subsurface`](#object-options) medium scatter light inside. |
|
|
206
|
+
| `volumes.enabled` | `true` | Meshes with a [`volume`](#object-options) are filled with their medium; off leaves them out. |
|
|
207
|
+
| `bevel.enabled` | `true` | Materials with a [`bevel`](#object-options) radius round their edges at shading time. |
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
renderer.setSettings({ glare: { blades: 7 }, camera: { whiteBalance: 3200 }, atmosphere: { visibility: 3000 } });
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`globalIllumination.denoise` (default `true`) turns the denoiser on: on the canvas a few times a second while the frame traces, and on the image `render()` resolves with. Switching it alone filters the finished image again without tracing.
|
|
180
214
|
|
|
181
215
|
### Denoiser
|
|
182
216
|
|
|
@@ -189,6 +223,8 @@ A variance-guided wavelet filter, the spatial half of SVGF, with the diffuse and
|
|
|
189
223
|
| `edge` | `2` | How large a luminance difference still counts as noise, in standard deviations of the pixel's own noise. Lower keeps more detail and removes less noise. |
|
|
190
224
|
| `onlyNoisy` | `true` | Leaves the pixels that have converged as they were traced, and filters only where noise is still visible. |
|
|
191
225
|
| `antiFirefly` | `true` | Before filtering, clamps a pixel brighter than every one of its eight neighbours to the brightest of them, in each signal. |
|
|
226
|
+
| `subsurface` | `1` | How far the diffuse filter lets go of its normal and depth tests over a material that scatters light inside, `0` to `1`: such light leaves the surface after wandering under it. |
|
|
227
|
+
| `mirrorRadius` | `3` | The smallest footprint a smooth reflection (roughness under 0.3) is filtered over, in pixels, by taps that see the reflected thing at the same distance, which keeps its edges. `0` leaves a mirror alone. |
|
|
192
228
|
|
|
193
229
|
A denoiser trades noise for detail. What it smooths most is what its guides cannot see: the relief of a lacquer, an out of focus area. With `onlyNoisy` it leaves alone whatever has already converged, so more samples always mean less filtering.
|
|
194
230
|
|
|
@@ -227,6 +263,18 @@ The renderer reads the CPU renderer's optional settings from `userData.cpuRender
|
|
|
227
263
|
light.userData.cpuRenderer = { volumetric: { density: 0.05 } };
|
|
228
264
|
```
|
|
229
265
|
|
|
266
|
+
Two more on materials, which only this renderer reads:
|
|
267
|
+
|
|
268
|
+
- **`subsurface`** (standard and physical materials): light enters the material and leaves it somewhere else, by a random walk inside it, as skin, wax, marble and milk do. `true` takes Blender's defaults. The material's colour, maps included, is what the medium reflects in all; `radius` is how far red, green and blue travel inside, as multiples of `scale` in scene units; `weight` is the share of the diffuse layer that scatters inside; `anisotropy` the phase function's.
|
|
269
|
+
- **`bevel`** (lit materials): a radius in scene units, over which the shading normal turns from one face to the next, as Cycles' bevel node rounds edges without changing the geometry. Sharp CG corners catch light like real, slightly rounded ones. The normal map still applies.
|
|
270
|
+
- **`volume`** (any material): the mesh only bounds a medium, which scatters and absorbs light in the space it encloses: fog, smoke, a beam of sunlight through dust, murky water. Its surface is invisible. `density` is per scene unit, `color` what each scattering keeps (white for fog, dark for soot), `anisotropy` how forward it scatters (about `0.7` for haze). The mesh has to be closed, with its normals out; the camera may stand inside one, and objects inside are lit through it.
|
|
271
|
+
|
|
272
|
+
```ts
|
|
273
|
+
skin.userData.cpuRenderer = { subsurface: { radius: [1, 0.4, 0.25], scale: 0.01 } };
|
|
274
|
+
table.userData.cpuRenderer = { bevel: 0.003 };
|
|
275
|
+
haze.material.userData.cpuRenderer = { volume: { density: 0.05, color: "#ffffff", anisotropy: 0.6 } };
|
|
276
|
+
```
|
|
277
|
+
|
|
230
278
|
### Helpers
|
|
231
279
|
|
|
232
280
|
| Function | |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PackedEnvironment } from "./environment.js";
|
|
2
|
+
import type { GpuRenderSettings } from "./settings.js";
|
|
3
|
+
import type { SerializedLight } from "./upstream.js";
|
|
4
|
+
/** Extinction per scene unit of red, green and blue for the atmosphere setting, or nothing when it is off. */
|
|
5
|
+
export declare function atmosphereExtinction(atmosphere: GpuRenderSettings["atmosphere"]): [number, number, number];
|
|
6
|
+
/** The brightest directional light of a scene, which lights the air: its direction towards the light and irradiance. */
|
|
7
|
+
export declare function brightestSun(lights: readonly SerializedLight[]): {
|
|
8
|
+
direction: number[];
|
|
9
|
+
irradiance: number[];
|
|
10
|
+
} | null;
|
|
11
|
+
/**
|
|
12
|
+
* The radiance of an image averaged over the whole sphere: what air scattering every direction alike sends towards the
|
|
13
|
+
* camera. Each row weighs by the sine of its colatitude, the share of the sphere it covers.
|
|
14
|
+
*/
|
|
15
|
+
export declare function averageRadiance(environment: PackedEnvironment): [number, number, number];
|
|
16
|
+
/**
|
|
17
|
+
* A vertical gradient averaged over the sphere. Directions are spread evenly in height over a sphere, so the share of
|
|
18
|
+
* the top colour is the mean of h^exponent for h even in [0, 1]: one over exponent plus one.
|
|
19
|
+
*/
|
|
20
|
+
export declare function gradientAverage(top: number[], bottom: number[], exponent: number): [number, number, number];
|
|
21
|
+
//# sourceMappingURL=atmosphere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere.d.ts","sourceRoot":"","sources":["../src/atmosphere.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAYrD,8GAA8G;AAC9G,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAS1G;AAED,wHAAwH;AACxH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG;IAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAmBrH;AAID;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CA8BxF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAI3G"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much more each colour scatters than green, at 680, 550 and 440 nm. Clean air scatters as the inverse fourth
|
|
3
|
+
* power of the wavelength (Rayleigh), haze nearly alike (Mie, an Angstrom exponent of about 1.3).
|
|
4
|
+
*/
|
|
5
|
+
const RAYLEIGH = [(550 / 680) ** 4, 1, (550 / 440) ** 4];
|
|
6
|
+
const MIE = [(550 / 680) ** 1.3, 1, (550 / 440) ** 1.3];
|
|
7
|
+
/** Koschmieder: a dark object fades to 2 percent contrast over the visibility, so green's extinction is ln 50 over it. */
|
|
8
|
+
const KOSCHMIEDER = Math.log(50);
|
|
9
|
+
/** Extinction per scene unit of red, green and blue for the atmosphere setting, or nothing when it is off. */
|
|
10
|
+
export function atmosphereExtinction(atmosphere) {
|
|
11
|
+
const visibility = Number(atmosphere.visibility);
|
|
12
|
+
if (!atmosphere.enabled || !(visibility > 0))
|
|
13
|
+
return [0, 0, 0];
|
|
14
|
+
const haze = Math.min(1, Math.max(0, Number(atmosphere.haze) || 0));
|
|
15
|
+
const scale = KOSCHMIEDER / visibility;
|
|
16
|
+
return [0, 1, 2].map(k => scale * (RAYLEIGH[k] + (MIE[k] - RAYLEIGH[k]) * haze));
|
|
17
|
+
}
|
|
18
|
+
/** The brightest directional light of a scene, which lights the air: its direction towards the light and irradiance. */
|
|
19
|
+
export function brightestSun(lights) {
|
|
20
|
+
let best = null;
|
|
21
|
+
let strongest = 0;
|
|
22
|
+
for (const light of lights) {
|
|
23
|
+
if (light.type !== "DirectionalLight" || !(light.intensity > 0))
|
|
24
|
+
continue;
|
|
25
|
+
const irradiance = light.color.map(channel => channel * light.intensity);
|
|
26
|
+
const strength = 0.2126 * irradiance[0] + 0.7152 * irradiance[1] + 0.0722 * irradiance[2];
|
|
27
|
+
const axis = [0, 1, 2].map(k => light.position[k] - light.target[k]);
|
|
28
|
+
const size = Math.hypot(...axis);
|
|
29
|
+
if (strength > strongest && size > 0) {
|
|
30
|
+
strongest = strength;
|
|
31
|
+
best = { direction: axis.map(value => value / size), irradiance };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return best;
|
|
35
|
+
}
|
|
36
|
+
const averages = new WeakMap();
|
|
37
|
+
/**
|
|
38
|
+
* The radiance of an image averaged over the whole sphere: what air scattering every direction alike sends towards the
|
|
39
|
+
* camera. Each row weighs by the sine of its colatitude, the share of the sphere it covers.
|
|
40
|
+
*/
|
|
41
|
+
export function averageRadiance(environment) {
|
|
42
|
+
const known = averages.get(environment);
|
|
43
|
+
if (known)
|
|
44
|
+
return known;
|
|
45
|
+
const { width, height, data } = environment.texture;
|
|
46
|
+
const sum = [0, 0, 0];
|
|
47
|
+
let weight = 0;
|
|
48
|
+
// A byte image is stored as it was encoded; only a float one holds linear light, as an HDR image always does.
|
|
49
|
+
const scale = data instanceof Float32Array ? 1 : 1 / 255;
|
|
50
|
+
for (let y = 0; y < height; y++) {
|
|
51
|
+
const sine = Math.sin((y + 0.5) / height * Math.PI);
|
|
52
|
+
for (let x = 0; x < width; x++) {
|
|
53
|
+
const at = (y * width + x) * 4;
|
|
54
|
+
sum[0] += data[at] * scale * sine;
|
|
55
|
+
sum[1] += data[at + 1] * scale * sine;
|
|
56
|
+
sum[2] += data[at + 2] * scale * sine;
|
|
57
|
+
}
|
|
58
|
+
weight += sine * width;
|
|
59
|
+
}
|
|
60
|
+
const average = sum.map(channel => channel / Math.max(weight, 1e-12));
|
|
61
|
+
averages.set(environment, average);
|
|
62
|
+
return average;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A vertical gradient averaged over the sphere. Directions are spread evenly in height over a sphere, so the share of
|
|
66
|
+
* the top colour is the mean of h^exponent for h even in [0, 1]: one over exponent plus one.
|
|
67
|
+
*/
|
|
68
|
+
export function gradientAverage(top, bottom, exponent) {
|
|
69
|
+
const share = 1 / (Math.max(exponent, 0) + 1);
|
|
70
|
+
return [0, 1, 2].map(k => bottom[k] + (top[k] - bottom[k]) * share);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=atmosphere.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atmosphere.js","sourceRoot":"","sources":["../src/atmosphere.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACzD,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;AAExD,0HAA0H;AAC1H,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAEjC,8GAA8G;AAC9G,MAAM,UAAU,oBAAoB,CAAC,UAA2C;IAC9E,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC,EA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
|
4
|
-
*
|
|
2
|
+
* Binned SAH bounding volume hierarchy. It is built as a binary tree of boxes, eight words a node, and then laid out
|
|
3
|
+
* the way the shader reads it: each node holds the boxes of its two children, so one read tells the traversal both
|
|
4
|
+
* what it may enter and where to go, and a leaf is tested without being read at all. That is sixteen words a node,
|
|
5
|
+
* matching `struct BvhNode` in `wgsl/common.wgsl.ts`: per child a minimum corner and a link, then a maximum corner and
|
|
6
|
+
* a triangle count. A link of zero or more is the node to go to; a negative one is a leaf, `-1 - start` into `order`.
|
|
5
7
|
*
|
|
6
8
|
* The bounds are computed from the same `Float32Array` the shader traverses, so every corner is already a float and
|
|
7
9
|
* needs no widening. Building from double precision positions, as the CPU renderer does, would need each minimum
|
|
8
10
|
* rounded down and each maximum rounded up before they reach the GPU.
|
|
9
11
|
*/
|
|
10
|
-
/** Words per node in the packed buffer. */
|
|
11
|
-
export declare const NODE_WORDS =
|
|
12
|
+
/** Words per node in the packed buffer: both children's corners, links and counts. */
|
|
13
|
+
export declare const NODE_WORDS = 16;
|
|
12
14
|
/**
|
|
13
15
|
* Deepest node the builder produces. The shader traverses with a fixed stack, and one entry per level is enough
|
|
14
16
|
* because a node only pushes its far child. Depth is capped rather than trusted.
|
|
15
17
|
*/
|
|
16
18
|
export declare const MAX_BVH_DEPTH = 32;
|
|
17
19
|
export interface PackedBvh {
|
|
18
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* `nodeCount * NODE_WORDS` words, read as floats for the corners and as signed integers for the links. Node zero
|
|
22
|
+
* holds the root's two children, or the root itself beside an empty child when the whole scene is one leaf.
|
|
23
|
+
*/
|
|
19
24
|
nodes: ArrayBuffer;
|
|
20
25
|
nodeCount: number;
|
|
21
26
|
/** Triangle indices in leaf order: a leaf covers `order[start] .. order[start + count - 1]`. */
|
package/dist/bvh.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bvh.d.ts","sourceRoot":"","sources":["../src/bvh.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bvh.d.ts","sourceRoot":"","sources":["../src/bvh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,sFAAsF;AACtF,eAAO,MAAM,UAAU,KAAK,CAAC;AAc7B;;;GAGG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuBD,wBAAgB,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,CA6HlF"}
|
package/dist/bvh.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Binned SAH bounding volume hierarchy
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Binned SAH bounding volume hierarchy. It is built as a binary tree of boxes, eight words a node, and then laid out
|
|
3
|
+
* the way the shader reads it: each node holds the boxes of its two children, so one read tells the traversal both
|
|
4
|
+
* what it may enter and where to go, and a leaf is tested without being read at all. That is sixteen words a node,
|
|
5
|
+
* matching `struct BvhNode` in `wgsl/common.wgsl.ts`: per child a minimum corner and a link, then a maximum corner and
|
|
6
|
+
* a triangle count. A link of zero or more is the node to go to; a negative one is a leaf, `-1 - start` into `order`.
|
|
5
7
|
*
|
|
6
8
|
* The bounds are computed from the same `Float32Array` the shader traverses, so every corner is already a float and
|
|
7
9
|
* needs no widening. Building from double precision positions, as the CPU renderer does, would need each minimum
|
|
8
10
|
* rounded down and each maximum rounded up before they reach the GPU.
|
|
9
11
|
*/
|
|
10
|
-
/** Words per node in the packed buffer. */
|
|
11
|
-
export const NODE_WORDS =
|
|
12
|
+
/** Words per node in the packed buffer: both children's corners, links and counts. */
|
|
13
|
+
export const NODE_WORDS = 16;
|
|
14
|
+
/** Words per node of the binary tree the builder works on: its own corners, and its children or its leaf. */
|
|
15
|
+
const BINARY_WORDS = 8;
|
|
12
16
|
/** Triangles a leaf may hold. */
|
|
13
17
|
const MAX_LEAF_SIZE = 4;
|
|
14
18
|
/** Candidate split positions evaluated per axis. */
|
|
@@ -45,14 +49,14 @@ export function buildBvh(positions, triangleCount) {
|
|
|
45
49
|
return { nodes: new ArrayBuffer(0), nodeCount: 0, order, maxDepth: 0 };
|
|
46
50
|
const { min, max, centroid } = triangleBounds(positions, triangleCount);
|
|
47
51
|
// The heuristic may split down to one triangle per leaf, so the pool starts at the common case and grows.
|
|
48
|
-
let nodes = new ArrayBuffer(Math.max(4, Math.ceil(triangleCount / 2)) *
|
|
52
|
+
let nodes = new ArrayBuffer(Math.max(4, Math.ceil(triangleCount / 2)) * BINARY_WORDS * 4);
|
|
49
53
|
let floats = new Float32Array(nodes);
|
|
50
54
|
let ints = new Int32Array(nodes);
|
|
51
55
|
const reserve = (needed) => {
|
|
52
|
-
if (needed *
|
|
56
|
+
if (needed * BINARY_WORDS * 4 <= nodes.byteLength)
|
|
53
57
|
return;
|
|
54
|
-
const grown = new ArrayBuffer(Math.max(needed, Math.ceil(nodes.byteLength / (
|
|
55
|
-
*
|
|
58
|
+
const grown = new ArrayBuffer(Math.max(needed, Math.ceil(nodes.byteLength / (BINARY_WORDS * 4) * 1.6))
|
|
59
|
+
* BINARY_WORDS * 4);
|
|
56
60
|
new Float32Array(grown).set(floats);
|
|
57
61
|
nodes = grown;
|
|
58
62
|
floats = new Float32Array(nodes);
|
|
@@ -113,7 +117,7 @@ export function buildBvh(positions, triangleCount) {
|
|
|
113
117
|
if (value > cMaxZ)
|
|
114
118
|
cMaxZ = value;
|
|
115
119
|
}
|
|
116
|
-
const word = node *
|
|
120
|
+
const word = node * BINARY_WORDS;
|
|
117
121
|
floats[word] = minX;
|
|
118
122
|
floats[word + 1] = minY;
|
|
119
123
|
floats[word + 2] = minZ;
|
|
@@ -150,7 +154,56 @@ export function buildBvh(positions, triangleCount) {
|
|
|
150
154
|
stack.set([start, split - start, left, depth + 1, split, end - split, right, depth + 1], top * 4);
|
|
151
155
|
top += 2;
|
|
152
156
|
}
|
|
153
|
-
return {
|
|
157
|
+
return { ...widen(floats, ints, nodeCount), order, maxDepth };
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The binary tree laid out for the shader: one node per interior node of it, holding both children's boxes. Interior
|
|
161
|
+
* nodes are numbered depth first, left before right, so a node and the child it leads to tend to share a cache line.
|
|
162
|
+
*/
|
|
163
|
+
function widen(floats, ints, binaryCount) {
|
|
164
|
+
const leaf = (node) => ints[node * BINARY_WORDS + 3] < 0;
|
|
165
|
+
const rootLeaf = leaf(0);
|
|
166
|
+
// A full binary tree has one fewer interior node than leaves; a single leaf still needs a node to stand in.
|
|
167
|
+
const nodeCount = rootLeaf ? 1 : (binaryCount - 1) / 2;
|
|
168
|
+
const nodes = new ArrayBuffer(nodeCount * NODE_WORDS * 4);
|
|
169
|
+
const outFloats = new Float32Array(nodes);
|
|
170
|
+
const outInts = new Int32Array(nodes);
|
|
171
|
+
const index = new Int32Array(binaryCount);
|
|
172
|
+
const writeChild = (word, child) => {
|
|
173
|
+
const from = child * BINARY_WORDS;
|
|
174
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
175
|
+
outFloats[word + axis] = floats[from + axis];
|
|
176
|
+
outFloats[word + 4 + axis] = floats[from + 4 + axis];
|
|
177
|
+
}
|
|
178
|
+
outInts[word + 3] = leaf(child) ? ints[from + 3] : index[child];
|
|
179
|
+
outInts[word + 7] = leaf(child) ? ints[from + 7] : 0;
|
|
180
|
+
};
|
|
181
|
+
if (rootLeaf) {
|
|
182
|
+
writeChild(0, 0);
|
|
183
|
+
// A box at the far corner of the float range, which no ray reaches, around a leaf of nothing.
|
|
184
|
+
for (let axis = 0; axis < 3; axis++)
|
|
185
|
+
outFloats[8 + axis] = outFloats[12 + axis] = 3.4028234663852886e38;
|
|
186
|
+
outInts[11] = -1;
|
|
187
|
+
outInts[15] = 0;
|
|
188
|
+
return { nodes, nodeCount };
|
|
189
|
+
}
|
|
190
|
+
const interior = [];
|
|
191
|
+
const pending = [0];
|
|
192
|
+
while (pending.length) {
|
|
193
|
+
const node = pending.pop();
|
|
194
|
+
index[node] = interior.length;
|
|
195
|
+
interior.push(node);
|
|
196
|
+
const left = ints[node * BINARY_WORDS + 3], right = ints[node * BINARY_WORDS + 7];
|
|
197
|
+
if (!leaf(right))
|
|
198
|
+
pending.push(right);
|
|
199
|
+
if (!leaf(left))
|
|
200
|
+
pending.push(left);
|
|
201
|
+
}
|
|
202
|
+
interior.forEach((node, at) => {
|
|
203
|
+
writeChild(at * NODE_WORDS, ints[node * BINARY_WORDS + 3]);
|
|
204
|
+
writeChild(at * NODE_WORDS + 8, ints[node * BINARY_WORDS + 7]);
|
|
205
|
+
});
|
|
206
|
+
return { nodes, nodeCount };
|
|
154
207
|
}
|
|
155
208
|
/** Surface area, the cost the split heuristic weighs each side by. Empty bounds cost nothing. */
|
|
156
209
|
function area(minX, minY, minZ, maxX, maxY, maxZ) {
|
package/dist/bvh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bvh.js","sourceRoot":"","sources":["../src/bvh.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2CAA2C;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAE5B,iCAAiC;AACjC,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,oDAAoD;AACpD,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,mFAAmF;AACnF,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAWhC,0EAA0E;AAC1E,SAAS,cAAc,CAAC,SAAuB,EAAE,aAAqB;IACpE,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,aAAa,GAAG,CAAC,CAAC,CAA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