feat: threads

This commit is contained in:
Dan Finch 2026-08-05 09:24:13 +02:00
parent 6fb46573da
commit 46e7070b6b
18 changed files with 878 additions and 125 deletions

View file

@ -46,6 +46,11 @@ export type RenderConfig = {
* short draw distance and the shimmer of far geometry. It also colors pixels
* no triangle covers, so the frame's clear color should match `fog.color`. */
fog: Fog | null
/** Beyond this distance (world units) trees + boulders draw as cheap low-poly
* impostors instead of full geometry, cutting per-triangle work in dense
* views. Kept inside `fog.far` so far detail is already fog-dimmed at the
* switch; `Infinity` disables LOD. */
lodDistance: number
}
/** Ready-made looks. The demo binds keys 1/2/3 to these, sweeping resolution,
@ -61,6 +66,7 @@ export namespace RenderConfig {
textureFilter: "nearest",
lighting: "flat",
fog: { color: Color.rgb(150, 170, 200), near: 12, far: 200 },
lodDistance: 60,
}
export const ps1: RenderConfig = {
@ -73,6 +79,7 @@ export namespace RenderConfig {
textureFilter: "nearest",
lighting: "flat",
fog: { color: Color.rgb(150, 170, 200), near: 12, far: 200 },
lodDistance: 60,
}
export const soft: RenderConfig = {
@ -85,6 +92,7 @@ export namespace RenderConfig {
textureFilter: "nearest",
lighting: "flat",
fog: { color: Color.rgb(170, 190, 215), near: 16, far: 240 },
lodDistance: 70,
}
export const clean: RenderConfig = {
@ -94,9 +102,9 @@ export namespace RenderConfig {
colorDepth: 8,
dither: 0,
vertexSnap: 0,
perspectiveCorrect: 1,
textureFilter: "linear",
lighting: "flat",
fog: null,
lodDistance: Infinity,
}
}