@plasius/gpu-lighting 0.1.19 → 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,6 +20,29 @@ 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.0] - 2026-06-06
24
+
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
+
23
46
  ## [0.1.19] - 2026-06-03
24
47
 
25
48
  - **Added**
@@ -331,3 +354,5 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
331
354
  [0.1.16]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.16
332
355
  [0.1.17]: https://github.com/Plasius-LTD/gpu-lighting/releases/tag/v0.1.17
333
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
@@ -114,18 +114,58 @@ 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.
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.
129
169
  `createWavefrontEnvironmentLightingOptions(...)` projects that contract into the
130
170
  current `@plasius/gpu-renderer` wavefront renderer options without making the
131
171
  renderer depend on this package directly.