@plasius/gpu-lighting 0.1.18 → 0.2.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/CHANGELOG.md CHANGED
@@ -20,9 +20,36 @@ 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.1.18] - 2026-06-01
23
+ ## [0.2.0] - 2026-06-06
24
24
 
25
25
  - **Added**
26
+ - Added environment-light portal contracts to the reusable environment
27
+ lighting config so renderers can guide and gate sky/HDRI contribution
28
+ through room openings such as windows.
29
+ - Added grass-field, forest, warehouse, and cavern environment lighting
30
+ preset families with dawn, midday, dusk, and night variants plus normalized
31
+ light-source metadata for environment-miss inference.
32
+ - Added scene/time-of-day preset aliases so callers can request environments
33
+ with `scene` plus `timeOfDay` instead of only combined preset names.
34
+
35
+ - **Changed**
36
+ - Pathtracer environment misses now resolve through non-null inferred
37
+ environment radiance, and emissive material hits contribute once before
38
+ terminating the active sample path.
39
+
40
+ - **Fixed**
41
+ - (placeholder)
42
+
43
+ - **Security**
44
+ - (placeholder)
45
+
46
+ ## [0.1.19] - 2026-06-03
47
+
48
+ - **Added**
49
+ - Added `createEnvironmentLightingConfig(...)` and
50
+ `createWavefrontEnvironmentLightingOptions(...)` so renderers and demos can
51
+ consume lighting-owned environment presets without embedding local ambient
52
+ or sky constants.
26
53
  - Concrete hybrid realtime WGSL kernels for `directLighting`,
27
54
  `screenTrace`, `radianceCache`, and `finalGather`.
28
55
 
@@ -326,4 +353,6 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
326
353
  [0.1.15]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.15
327
354
  [0.1.16]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.16
328
355
  [0.1.17]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.17
329
- [0.1.18]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.18
356
+ [0.1.19]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.19
357
+ [Unreleased]: https://github.com/Plasius-LTD/gpu-lighting/compare/v0.2.0...HEAD
358
+ [0.2.0]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.2.0
package/README.md CHANGED
@@ -105,6 +105,71 @@ Band plans make near, mid, far, and horizon shadow sources explicit, keep RT
105
105
  shadow/reflection/GI participation independent, and publish temporal reuse plus
106
106
  update cadence expectations for downstream renderer and performance packages.
107
107
 
108
+ ## Environment Lighting Presets
109
+
110
+ ```js
111
+ import {
112
+ createEnvironmentLightingConfig,
113
+ createWavefrontEnvironmentLightingOptions,
114
+ } from "@plasius/gpu-lighting";
115
+
116
+ const lighting = createEnvironmentLightingConfig({
117
+ scene: "forest",
118
+ timeOfDay: "dusk",
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
+ ],
131
+ });
132
+
133
+ const wavefrontLighting = createWavefrontEnvironmentLightingOptions({
134
+ preset: "cavern-night",
135
+ });
136
+
137
+ console.log(lighting.environmentLightSources.map((source) => source.kind));
138
+ console.log(wavefrontLighting.environmentMissLighting.startingPoint);
139
+ ```
140
+
141
+ `createEnvironmentLightingConfig(...)` owns the reusable sky/environment
142
+ semantics: horizon and zenith colours, key-light direction, key-light colour,
143
+ environment intensity, exposure, ambient residual colour, and optional
144
+ environment-light portals.
145
+
146
+ Preset families now cover:
147
+
148
+ - `grass-field-{dawn,midday,dusk,night}`
149
+ - `forest-{dawn,midday,dusk,night}`
150
+ - `warehouse-{dawn,midday,dusk,night}`
151
+ - `cavern-{dawn,midday,dusk,night}`
152
+
153
+ Callers can pass the combined `preset` name directly or pass `scene` plus
154
+ `timeOfDay`; scene-only aliases default to `midday`.
155
+
156
+ Each preset publishes `scene`, `timeOfDay`, normalized
157
+ `environmentLightSources`, a `dominantLightSource`, and
158
+ `environmentMissLighting`. Source metadata includes source kind, role, direction,
159
+ position, colour, intensity, radiance, luminance, reach, and angular radius.
160
+ Renderers can use `environmentMissLighting` when a path ray misses scene
161
+ geometry: the miss has an inferred source colour/brightness and a stable
162
+ `startingPoint` of `environment-miss` instead of an unbounded null/negative sky
163
+ sample. Emissive material hits remain explicit light-source hits and should not
164
+ be double-counted by environment inference.
165
+
166
+ Portals describe physical openings such as windows where outside radiance can
167
+ enter an interior. They are normalized as rectangle apertures with position,
168
+ normal, tangent, dimensions, colour, and radiance scale.
169
+ `createWavefrontEnvironmentLightingOptions(...)` projects that contract into the
170
+ current `@plasius/gpu-renderer` wavefront renderer options without making the
171
+ renderer depend on this package directly.
172
+
108
173
  ## DAG Scheduling
109
174
 
110
175
  Lighting worker manifests now publish `schedulerMode: "dag"` plus per-job