@plasius/gpu-lighting 0.1.19 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -20,6 +20,50 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
20
20
  - **Security**
21
21
  - (placeholder)
22
22
 
23
+ ## [0.2.2] - 2026-06-11
24
+
25
+ - **Added**
26
+ - Added `environmentMap`/`hdri` passthrough in wavefront lighting options so
27
+ renderers can use HDRI/equirectangular radiance textures as environment
28
+ light sources instead of relying primarily on static ambient colours.
29
+ - Added `sunlitBaseline` to environment lighting presets and wavefront
30
+ lighting options so renderers can apply a time-of-day daylight floor at
31
+ terminal path collisions without raising ambient residual colour.
32
+ - (placeholder)
33
+
34
+ - **Changed**
35
+ - Reduced ambient residual strength for the grass-field, forest, warehouse,
36
+ and cavern environment preset families to avoid low-sample whitewash.
37
+
38
+ - **Fixed**
39
+ - (placeholder)
40
+
41
+ - **Security**
42
+ - (placeholder)
43
+
44
+ ## [0.2.0] - 2026-06-06
45
+
46
+ - **Added**
47
+ - Added environment-light portal contracts to the reusable environment
48
+ lighting config so renderers can guide and gate sky/HDRI contribution
49
+ through room openings such as windows.
50
+ - Added grass-field, forest, warehouse, and cavern environment lighting
51
+ preset families with dawn, midday, dusk, and night variants plus normalized
52
+ light-source metadata for environment-miss inference.
53
+ - Added scene/time-of-day preset aliases so callers can request environments
54
+ with `scene` plus `timeOfDay` instead of only combined preset names.
55
+
56
+ - **Changed**
57
+ - Pathtracer environment misses now resolve through non-null inferred
58
+ environment radiance, and emissive material hits contribute once before
59
+ terminating the active sample path.
60
+
61
+ - **Fixed**
62
+ - (placeholder)
63
+
64
+ - **Security**
65
+ - (placeholder)
66
+
23
67
  ## [0.1.19] - 2026-06-03
24
68
 
25
69
  - **Added**
@@ -331,3 +375,6 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
331
375
  [0.1.16]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.16
332
376
  [0.1.17]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.17
333
377
  [0.1.19]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.19
378
+ [Unreleased]: https://github.com/Plasius-LTD/gpu-lighting/compare/v0.2.2...HEAD
379
+ [0.2.0]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.2.0
380
+ [0.2.2]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.2.2
package/README.md CHANGED
@@ -114,18 +114,67 @@ import {
114
114
  } from "@plasius/gpu-lighting";
115
115
 
116
116
  const lighting = createEnvironmentLightingConfig({
117
- preset: "product-studio",
117
+ scene: "forest",
118
+ timeOfDay: "dusk",
118
119
  intensity: 1.05,
120
+ environmentPortals: [
121
+ {
122
+ id: "north-window",
123
+ position: [0, 1.2, -2.4],
124
+ normal: [0, 0, 1],
125
+ tangent: [1, 0, 0],
126
+ width: 1.8,
127
+ height: 1.1,
128
+ intensity: 1.4,
129
+ },
130
+ ],
119
131
  });
120
132
 
121
133
  const wavefrontLighting = createWavefrontEnvironmentLightingOptions({
122
- preset: "moonlit-harbor",
134
+ preset: "cavern-night",
123
135
  });
136
+
137
+ console.log(lighting.environmentLightSources.map((source) => source.kind));
138
+ console.log(wavefrontLighting.environmentMissLighting.startingPoint);
124
139
  ```
125
140
 
126
141
  `createEnvironmentLightingConfig(...)` owns the reusable sky/environment
127
142
  semantics: horizon and zenith colours, key-light direction, key-light colour,
128
- environment intensity, exposure, and ambient residual colour.
143
+ environment intensity, exposure, ambient residual colour, and optional
144
+ environment-light portals. The grass-field, forest, warehouse, and cavern
145
+ families use restrained ambient residual scaling so low-sample renderers keep
146
+ some final-bounce colour without washing dark materials toward white. They also
147
+ publish `sunlitBaseline`, a scene-scaled time-of-day daylight floor that
148
+ renderers can use at terminal path collisions without raising the global
149
+ ambient colour.
150
+
151
+ Preset families now cover:
152
+
153
+ - `grass-field-{dawn,midday,dusk,night}`
154
+ - `forest-{dawn,midday,dusk,night}`
155
+ - `warehouse-{dawn,midday,dusk,night}`
156
+ - `cavern-{dawn,midday,dusk,night}`
157
+
158
+ Callers can pass the combined `preset` name directly or pass `scene` plus
159
+ `timeOfDay`; scene-only aliases default to `midday`.
160
+
161
+ Each preset publishes `scene`, `timeOfDay`, normalized
162
+ `sunlitBaseline`, `environmentLightSources`, a `dominantLightSource`, and
163
+ `environmentMissLighting`. Source metadata includes source kind, role, direction,
164
+ position, colour, intensity, radiance, luminance, reach, and angular radius.
165
+ Renderers can use `environmentMissLighting` when a path ray misses scene
166
+ geometry: the miss has an inferred source colour/brightness and a stable
167
+ `startingPoint` of `environment-miss` instead of an unbounded null/negative sky
168
+ sample. Emissive material hits remain explicit light-source hits and should not
169
+ be double-counted by environment inference. Callers can also pass an
170
+ `environmentMap`/`hdri` descriptor; the lighting config preserves it in
171
+ `createWavefrontEnvironmentLightingOptions(...)` so the wavefront renderer can
172
+ sample an equirectangular radiance map for environment misses and ambient
173
+ residuals instead of relying primarily on static ambient values.
174
+
175
+ Portals describe physical openings such as windows where outside radiance can
176
+ enter an interior. They are normalized as rectangle apertures with position,
177
+ normal, tangent, dimensions, colour, and radiance scale.
129
178
  `createWavefrontEnvironmentLightingOptions(...)` projects that contract into the
130
179
  current `@plasius/gpu-renderer` wavefront renderer options without making the
131
180
  renderer depend on this package directly.