ugly-game 0.15.67 → 0.15.68

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.
@@ -35,8 +35,10 @@ export interface PropLook {
35
35
  /**
36
36
  * 'legacy' (default) is the historical `hdr / (1 + 0.35·hdr)` highlight compression.
37
37
  * 'aces' is Stephen Hill's fitted ACES (RRT+ODT) curve, applied after `exposure`.
38
+ * 'linear' emits exposed linear HDR radiance without tone mapping or sRGB
39
+ * conversion, for a scene target whose compositor owns the display transform.
38
40
  */
39
- toneMapping: 'legacy' | 'aces';
41
+ toneMapping: 'legacy' | 'aces' | 'linear';
40
42
  /** Linear multiplier on HDR radiance before tone mapping. Default 1. */
41
43
  exposure: number;
42
44
  /**
@@ -18,7 +18,7 @@ const SHADER = /* wgsl */ `
18
18
  // byte-identical. lightVP remains the legacy cascade-0 slot; shading reads cascades instead.
19
19
  // look + look2 (the opt-in photoreal controls, see PropLook) are appended after the cascades for the
20
20
  // same reason, and every one of their defaults selects the exact expressions that ran before them:
21
- // look = (toneMapping 0 legacy / 1 aces, exposure, environment-diffuse intensity (0 ⇒ flat amb),
21
+ // look = (toneMapping 0 legacy / 1 aces / 2 linear HDR, exposure, environment-diffuse intensity (0 ⇒ flat amb),
22
22
  // environment specular for every PBR material (0/1))
23
23
  // look2 = (shadow filter 0 pcf3 / 1 pcf5 / 2 pcf7 / 3 poisson, radius in texels,
24
24
  // scene-environment max lod, scene-environment irradiance lod)
@@ -310,6 +310,7 @@ fn acesFitted(c: vec3<f32>) -> vec3<f32> {
310
310
  // Linear HDR → display sRGB. look.x = 0 is the historical highlight compression, untouched.
311
311
  fn toneMap(hdr: vec3<f32>) -> vec3<f32> {
312
312
  let x = hdr * u.look.y;
313
+ if (u.look.x > 1.5) { return max(x, vec3(0.0)); }
313
314
  if (u.look.x > 0.5) { return linearToSrgb(acesFitted(max(x, vec3(0.0)))); }
314
315
  return linearToSrgb(x / (vec3(1.0) + x * 0.35));
315
316
  }
@@ -1516,7 +1517,7 @@ export class GpuPropsRenderer {
1516
1517
  const envMaxLod = env ? env.mipLevelCount - 1 : 0;
1517
1518
  const lookAt = 72 + 16 * MAX_CASCADES;
1518
1519
  u.set([
1519
- look.toneMapping === 'aces' ? 1 : 0,
1520
+ look.toneMapping === 'linear' ? 2 : look.toneMapping === 'aces' ? 1 : 0,
1520
1521
  Number.isFinite(look.exposure) ? Math.max(0, look.exposure) : 1,
1521
1522
  env && look.environmentDiffuse > 0 ? look.environmentDiffuse : 0,
1522
1523
  env && look.environmentSpecular ? 1 : 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugly-game",
3
- "version": "0.15.67",
3
+ "version": "0.15.68",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {