@luma.gl/engine 10.0.0-alpha.14 → 10.0.0-alpha.16
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/dist/arrow/index.cjs.map +2 -2
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +12 -13
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts.map +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +22 -17
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
- package/dist/dist.dev.js +0 -37
- package/dist/dist.min.js +58 -58
- package/dist/lighting/index.cjs +12 -2
- package/dist/lighting/index.cjs.map +3 -3
- package/dist/lighting/index.d.ts +4 -0
- package/dist/lighting/index.d.ts.map +1 -1
- package/dist/lighting/index.js +2 -0
- package/dist/lighting/index.js.map +1 -1
- package/dist/lighting/lightmap-atlas.cjs +246 -0
- package/dist/lighting/lightmap-atlas.d.ts +53 -0
- package/dist/lighting/lightmap-atlas.d.ts.map +1 -0
- package/dist/lighting/lightmap-atlas.js +279 -0
- package/dist/lighting/lightmap-atlas.js.map +1 -0
- package/dist/lighting/reflection-probe.cjs +321 -0
- package/dist/lighting/reflection-probe.d.ts +77 -0
- package/dist/lighting/reflection-probe.d.ts.map +1 -0
- package/dist/lighting/reflection-probe.js +298 -0
- package/dist/lighting/reflection-probe.js.map +1 -0
- package/package.json +8 -8
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +23 -19
- package/src/lighting/index.ts +18 -0
- package/src/lighting/lightmap-atlas.ts +348 -0
- package/src/lighting/reflection-probe.ts +360 -0
- package/src/splats/README.md +1 -1
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var reflection_probe_exports = {};
|
|
19
|
+
__export(reflection_probe_exports, {
|
|
20
|
+
ReflectionProbe: () => ReflectionProbe
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(reflection_probe_exports);
|
|
23
|
+
var import_core = require("@luma.gl/core");
|
|
24
|
+
var import_core2 = require("@math.gl/core");
|
|
25
|
+
var import_shaders = require("@luma.gl/shaders");
|
|
26
|
+
var import_clip_space = require("../models/clip-space.cjs");
|
|
27
|
+
var import_shader_inputs = require("../shader-inputs.cjs");
|
|
28
|
+
const FACES = [
|
|
29
|
+
{ direction: [1, 0, 0], up: [0, -1, 0] },
|
|
30
|
+
{ direction: [-1, 0, 0], up: [0, -1, 0] },
|
|
31
|
+
{ direction: [0, 1, 0], up: [0, 0, 1] },
|
|
32
|
+
{ direction: [0, -1, 0], up: [0, 0, -1] },
|
|
33
|
+
{ direction: [0, 0, 1], up: [0, -1, 0] },
|
|
34
|
+
{ direction: [0, 0, -1], up: [0, -1, 0] }
|
|
35
|
+
];
|
|
36
|
+
class ReflectionProbe {
|
|
37
|
+
device;
|
|
38
|
+
origin;
|
|
39
|
+
matrixSnapshot;
|
|
40
|
+
capture;
|
|
41
|
+
depth;
|
|
42
|
+
targets;
|
|
43
|
+
views = [];
|
|
44
|
+
framebuffers = [];
|
|
45
|
+
captureTargets = [];
|
|
46
|
+
filterTargets = [];
|
|
47
|
+
filter;
|
|
48
|
+
size;
|
|
49
|
+
sampleCount;
|
|
50
|
+
activeSampleCount;
|
|
51
|
+
budget;
|
|
52
|
+
maximumFaces;
|
|
53
|
+
sameFrame;
|
|
54
|
+
projectionMatrix = new import_core2.Matrix4([
|
|
55
|
+
1,
|
|
56
|
+
0,
|
|
57
|
+
0,
|
|
58
|
+
0,
|
|
59
|
+
0,
|
|
60
|
+
-1,
|
|
61
|
+
0,
|
|
62
|
+
0,
|
|
63
|
+
0,
|
|
64
|
+
0,
|
|
65
|
+
0.5,
|
|
66
|
+
0,
|
|
67
|
+
0,
|
|
68
|
+
0,
|
|
69
|
+
0.5,
|
|
70
|
+
1
|
|
71
|
+
]).multiplyRight(new import_core2.Matrix4().perspective({ fovy: Math.PI / 2, aspect: 1, near: 0.05, far: 100 }));
|
|
72
|
+
pendingFaces = /* @__PURE__ */ new Set();
|
|
73
|
+
captureCount = 0;
|
|
74
|
+
filteredCount = 0;
|
|
75
|
+
front;
|
|
76
|
+
back = 0;
|
|
77
|
+
credit = 0;
|
|
78
|
+
pausedFrames = 0;
|
|
79
|
+
destroyed = false;
|
|
80
|
+
constructor(device, props = {}) {
|
|
81
|
+
(0, import_core.assert)(device.type === "webgpu");
|
|
82
|
+
this.device = device;
|
|
83
|
+
this.size = props.size ?? 32;
|
|
84
|
+
this.sampleCount = props.sampleCount ?? 16;
|
|
85
|
+
this.activeSampleCount = this.sampleCount;
|
|
86
|
+
this.budget = props.frameBudgetMilliseconds ?? 1e3 / 60;
|
|
87
|
+
this.maximumFaces = props.maximumFacesPerFrame ?? 2;
|
|
88
|
+
this.sameFrame = props.refreshMode === "same-frame";
|
|
89
|
+
(0, import_core.assert)(Number.isInteger(this.size) && this.size > 0 && this.size <= device.limits.maxTextureDimension2D);
|
|
90
|
+
(0, import_core.assert)(Number.isInteger(this.sampleCount) && this.sampleCount > 0 && this.sampleCount <= 1024);
|
|
91
|
+
(0, import_core.assert)(Number.isFinite(this.budget) && this.budget > 0);
|
|
92
|
+
(0, import_core.assert)(Number.isInteger(this.maximumFaces) && this.maximumFaces > 0 && this.maximumFaces <= 6);
|
|
93
|
+
const capabilities = device.getTextureFormatCapabilities("rgba16float");
|
|
94
|
+
(0, import_core.assert)(capabilities.render && capabilities.filter);
|
|
95
|
+
const requestedMipLevels = props.mipLevels ?? 4;
|
|
96
|
+
(0, import_core.assert)(Number.isSafeInteger(requestedMipLevels) && requestedMipLevels > 0);
|
|
97
|
+
const mipLevels = Math.min(requestedMipLevels, device.getMipLevelCount(this.size, this.size));
|
|
98
|
+
this.origin = device.createBuffer({ byteLength: 16, usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST });
|
|
99
|
+
this.capture = this.createCube("reflection-capture", 1);
|
|
100
|
+
this.targets = [
|
|
101
|
+
this.createCube("reflection-filter-a", mipLevels),
|
|
102
|
+
this.createCube("reflection-filter-b", mipLevels)
|
|
103
|
+
];
|
|
104
|
+
this.depth = device.createTexture({
|
|
105
|
+
width: this.size,
|
|
106
|
+
height: this.size,
|
|
107
|
+
format: "depth24plus",
|
|
108
|
+
usage: import_core.Texture.RENDER
|
|
109
|
+
});
|
|
110
|
+
for (let face = 0; face < FACES.length; face++)
|
|
111
|
+
this.captureTargets.push(this.createTarget(this.capture, face, 0, this.depth));
|
|
112
|
+
for (const texture of this.targets) {
|
|
113
|
+
this.filterTargets.push(FACES.map((_, face) => Array.from({ length: mipLevels - 1 }, (_2, mip) => this.createTarget(texture, face, mip + 1))));
|
|
114
|
+
}
|
|
115
|
+
this.filter = new import_clip_space.ClipSpace(device, {
|
|
116
|
+
id: "reflection-probe-filter",
|
|
117
|
+
source: import_shaders.PBR_ENVIRONMENT_FRAGMENT_WGSL,
|
|
118
|
+
defines: { PBR_ENVIRONMENT_CUBE_SOURCE: true },
|
|
119
|
+
modules: [import_shaders.pbrEnvironmentFilter],
|
|
120
|
+
shaderInputs: new import_shader_inputs.ShaderInputs({ pbrEnvironmentFilter: import_shaders.pbrEnvironmentFilter }),
|
|
121
|
+
colorAttachmentFormats: ["rgba16float"],
|
|
122
|
+
parameters: { depthWriteEnabled: false }
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
get texture() {
|
|
126
|
+
return this.front === void 0 ? void 0 : this.targets[this.front];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Record capture and filtering before the main draw. A budget estimate controls work or quality.
|
|
130
|
+
* Returns the number of face work units recorded. Submit the frame before calling again.
|
|
131
|
+
*/
|
|
132
|
+
update(options) {
|
|
133
|
+
var _a, _b;
|
|
134
|
+
(0, import_core.assert)(!this.destroyed);
|
|
135
|
+
(0, import_core.assert)(options.matrices.device === this.device && options.matrices.usage & import_core.Buffer.COPY_SRC);
|
|
136
|
+
(0, import_core.assert)(Number.isSafeInteger(options.matrixIndex) && options.matrixIndex >= 0 && (options.matrixIndex + 1) * 64 <= options.matrices.byteLength);
|
|
137
|
+
if (options.refresh === false && this.front !== void 0 && this.captureCount === 0)
|
|
138
|
+
return 0;
|
|
139
|
+
const snapshotChanged = ((_a = this.matrixSnapshot) == null ? void 0 : _a.byteLength) !== options.matrices.byteLength;
|
|
140
|
+
if (snapshotChanged) {
|
|
141
|
+
(_b = this.matrixSnapshot) == null ? void 0 : _b.destroy();
|
|
142
|
+
this.matrixSnapshot = this.device.createBuffer({
|
|
143
|
+
byteLength: options.matrices.byteLength,
|
|
144
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC
|
|
145
|
+
});
|
|
146
|
+
this.captureCount = 0;
|
|
147
|
+
this.filteredCount = 0;
|
|
148
|
+
this.pendingFaces.clear();
|
|
149
|
+
}
|
|
150
|
+
const measured = options.frameMilliseconds;
|
|
151
|
+
const headroom = measured !== void 0 && Number.isFinite(measured) ? Math.max(0, Math.min(this.budget, this.budget - measured)) : this.budget / 4;
|
|
152
|
+
let available;
|
|
153
|
+
if (this.sameFrame) {
|
|
154
|
+
if (measured !== void 0 && Number.isFinite(measured)) {
|
|
155
|
+
if (measured > this.budget) {
|
|
156
|
+
this.activeSampleCount = Math.max(Math.min(4, this.sampleCount), Math.floor(this.activeSampleCount / 2));
|
|
157
|
+
} else if (headroom >= this.budget / 4) {
|
|
158
|
+
this.activeSampleCount = Math.min(this.sampleCount, this.activeSampleCount + 1);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
available = FACES.length * 2;
|
|
162
|
+
} else {
|
|
163
|
+
this.credit = Math.min(this.maximumFaces, this.credit + headroom);
|
|
164
|
+
available = Math.floor(this.credit);
|
|
165
|
+
if (available === 0 && ++this.pausedFrames >= 3)
|
|
166
|
+
available = 1;
|
|
167
|
+
if (available === 0)
|
|
168
|
+
return 0;
|
|
169
|
+
this.credit = Math.max(0, this.credit - available);
|
|
170
|
+
}
|
|
171
|
+
this.pausedFrames = 0;
|
|
172
|
+
if (this.captureCount === 0 && this.filteredCount === 0) {
|
|
173
|
+
this.device.commandEncoder.copyBufferToBuffer({
|
|
174
|
+
sourceBuffer: options.matrices,
|
|
175
|
+
destinationBuffer: this.matrixSnapshot,
|
|
176
|
+
size: options.matrices.byteLength
|
|
177
|
+
});
|
|
178
|
+
this.device.commandEncoder.copyBufferToBuffer({
|
|
179
|
+
sourceBuffer: this.matrixSnapshot,
|
|
180
|
+
sourceOffset: options.matrixIndex * 64 + 48,
|
|
181
|
+
destinationBuffer: this.origin,
|
|
182
|
+
size: 16
|
|
183
|
+
});
|
|
184
|
+
for (let face = 0; face < FACES.length; face++)
|
|
185
|
+
this.pendingFaces.add(face);
|
|
186
|
+
}
|
|
187
|
+
let used = 0;
|
|
188
|
+
while (used < available && this.captureCount < FACES.length) {
|
|
189
|
+
const face = this.nextFace(options.viewDirections ?? []);
|
|
190
|
+
const { direction, up } = FACES[face];
|
|
191
|
+
options.draw({
|
|
192
|
+
face,
|
|
193
|
+
framebuffer: this.captureTargets[face],
|
|
194
|
+
viewMatrix: new import_core2.Matrix4().lookAt({ eye: [0, 0, 0], center: direction, up }),
|
|
195
|
+
projectionMatrix: this.projectionMatrix,
|
|
196
|
+
matrices: this.matrixSnapshot,
|
|
197
|
+
origin: this.origin
|
|
198
|
+
});
|
|
199
|
+
this.pendingFaces.delete(face);
|
|
200
|
+
this.captureCount++;
|
|
201
|
+
used++;
|
|
202
|
+
}
|
|
203
|
+
while (used < available && this.filteredCount < FACES.length) {
|
|
204
|
+
this.filterFace(this.filteredCount);
|
|
205
|
+
this.filteredCount++;
|
|
206
|
+
used++;
|
|
207
|
+
}
|
|
208
|
+
if (this.filteredCount === FACES.length) {
|
|
209
|
+
this.front = this.back;
|
|
210
|
+
this.back = 1 - this.back;
|
|
211
|
+
this.captureCount = 0;
|
|
212
|
+
this.filteredCount = 0;
|
|
213
|
+
}
|
|
214
|
+
return used;
|
|
215
|
+
}
|
|
216
|
+
destroy() {
|
|
217
|
+
var _a;
|
|
218
|
+
if (this.destroyed)
|
|
219
|
+
return;
|
|
220
|
+
this.destroyed = true;
|
|
221
|
+
this.filter.destroy();
|
|
222
|
+
for (const framebuffer of this.framebuffers)
|
|
223
|
+
framebuffer.destroy();
|
|
224
|
+
for (const view of this.views)
|
|
225
|
+
view.destroy();
|
|
226
|
+
for (const target of this.targets)
|
|
227
|
+
target.destroy();
|
|
228
|
+
this.capture.destroy();
|
|
229
|
+
this.depth.destroy();
|
|
230
|
+
this.origin.destroy();
|
|
231
|
+
(_a = this.matrixSnapshot) == null ? void 0 : _a.destroy();
|
|
232
|
+
}
|
|
233
|
+
nextFace(directions) {
|
|
234
|
+
let bestFace = -1;
|
|
235
|
+
let bestScore = -Infinity;
|
|
236
|
+
for (const face of this.pendingFaces) {
|
|
237
|
+
const normal = FACES[face].direction;
|
|
238
|
+
const score = directions.length ? Math.max(...directions.map((direction) => {
|
|
239
|
+
const length = Math.hypot(...direction);
|
|
240
|
+
return length > 0 ? (normal[0] * direction[0] + normal[1] * direction[1] + normal[2] * direction[2]) / length : 0;
|
|
241
|
+
})) : 0;
|
|
242
|
+
if (score > bestScore) {
|
|
243
|
+
bestScore = score;
|
|
244
|
+
bestFace = face;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return bestFace;
|
|
248
|
+
}
|
|
249
|
+
createCube(id, mipLevels) {
|
|
250
|
+
return this.device.createTexture({
|
|
251
|
+
id,
|
|
252
|
+
dimension: "cube",
|
|
253
|
+
width: this.size,
|
|
254
|
+
height: this.size,
|
|
255
|
+
depth: 6,
|
|
256
|
+
format: "rgba16float",
|
|
257
|
+
mipLevels,
|
|
258
|
+
usage: import_core.Texture.RENDER | import_core.Texture.SAMPLE | import_core.Texture.COPY_SRC | import_core.Texture.COPY_DST,
|
|
259
|
+
sampler: { minFilter: "linear", magFilter: "linear", mipmapFilter: "linear" }
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
createTarget(texture, face, mip, depth = null) {
|
|
263
|
+
const view = texture.createView({
|
|
264
|
+
dimension: "2d",
|
|
265
|
+
baseArrayLayer: face,
|
|
266
|
+
arrayLayerCount: 1,
|
|
267
|
+
baseMipLevel: mip,
|
|
268
|
+
mipLevelCount: 1
|
|
269
|
+
});
|
|
270
|
+
this.views.push(view);
|
|
271
|
+
const size = Math.max(1, this.size >> mip);
|
|
272
|
+
const framebuffer = this.device.createFramebuffer({
|
|
273
|
+
width: size,
|
|
274
|
+
height: size,
|
|
275
|
+
colorAttachments: [view],
|
|
276
|
+
depthStencilAttachment: depth
|
|
277
|
+
});
|
|
278
|
+
this.framebuffers.push(framebuffer);
|
|
279
|
+
return framebuffer;
|
|
280
|
+
}
|
|
281
|
+
filterFace(face) {
|
|
282
|
+
const targets = this.filterTargets[this.back][face];
|
|
283
|
+
this.device.commandEncoder.copyTextureToTexture({
|
|
284
|
+
sourceTexture: this.capture,
|
|
285
|
+
destinationTexture: this.targets[this.back],
|
|
286
|
+
origin: [0, 0, face],
|
|
287
|
+
destinationOrigin: [0, 0, face],
|
|
288
|
+
width: this.size,
|
|
289
|
+
height: this.size,
|
|
290
|
+
depthOrArrayLayers: 1
|
|
291
|
+
});
|
|
292
|
+
for (const [index, framebuffer] of targets.entries()) {
|
|
293
|
+
const mip = index + 1;
|
|
294
|
+
this.filter.shaderInputs.setProps({
|
|
295
|
+
pbrEnvironmentFilter: {
|
|
296
|
+
face,
|
|
297
|
+
roughness: mip / targets.length,
|
|
298
|
+
mode: 0,
|
|
299
|
+
sampleCount: this.activeSampleCount,
|
|
300
|
+
sourceEncoding: 0,
|
|
301
|
+
pbrEnvironmentSource: this.capture
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
this.filter.predraw(this.device.commandEncoder);
|
|
305
|
+
const pass = this.device.beginRenderPass({
|
|
306
|
+
framebuffer,
|
|
307
|
+
clearColor: [0, 0, 0, 1],
|
|
308
|
+
clearDepth: false
|
|
309
|
+
});
|
|
310
|
+
try {
|
|
311
|
+
this.filter.draw(pass);
|
|
312
|
+
} finally {
|
|
313
|
+
pass.end();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
319
|
+
0 && (module.exports = {
|
|
320
|
+
ReflectionProbe
|
|
321
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Buffer, type Device, type Framebuffer, Texture } from '@luma.gl/core';
|
|
2
|
+
import { Matrix4, type NumberArray3 } from '@math.gl/core';
|
|
3
|
+
export type ReflectionProbeView = {
|
|
4
|
+
face: number;
|
|
5
|
+
framebuffer: Framebuffer;
|
|
6
|
+
/** Face rotation. The renderer subtracts the GPU origin before applying this matrix. */
|
|
7
|
+
viewMatrix: Matrix4;
|
|
8
|
+
projectionMatrix: Matrix4;
|
|
9
|
+
/** One vec4f containing the capture origin; borrowed until the next update cycle. */
|
|
10
|
+
origin: Buffer;
|
|
11
|
+
/** Snapshot of all source poses, shared across the six capture faces. */
|
|
12
|
+
matrices: Buffer;
|
|
13
|
+
};
|
|
14
|
+
export type ReflectionProbeUpdate = {
|
|
15
|
+
/** Producer buffer with COPY_SRC usage and a column-major float32 matrix at matrixIndex. */
|
|
16
|
+
matrices: Buffer;
|
|
17
|
+
matrixIndex: number;
|
|
18
|
+
/** Last completed frame's measured CPU-to-GPU-completion work, in milliseconds. */
|
|
19
|
+
frameMilliseconds?: number;
|
|
20
|
+
/** When false, finish any current refresh and retain it until the scene changes. */
|
|
21
|
+
refresh?: boolean;
|
|
22
|
+
/** World-space directions from the probe toward the views that sample it. */
|
|
23
|
+
viewDirections?: readonly Readonly<NumberArray3>[];
|
|
24
|
+
draw: (view: ReflectionProbeView) => void;
|
|
25
|
+
};
|
|
26
|
+
export type ReflectionProbeProps = {
|
|
27
|
+
size?: number;
|
|
28
|
+
sampleCount?: number;
|
|
29
|
+
frameBudgetMilliseconds?: number;
|
|
30
|
+
maximumFacesPerFrame?: number;
|
|
31
|
+
/** Capture and publish in the same frame, with the budget controlling filtering quality. */
|
|
32
|
+
refreshMode?: 'incremental' | 'same-frame';
|
|
33
|
+
/** Number of specular mips, including the sharp capture. Defaults to four, up to the texture limit. */
|
|
34
|
+
mipLevels?: number;
|
|
35
|
+
};
|
|
36
|
+
/** WebGPU capture and specular filtering with a complete, double-buffered publication. */
|
|
37
|
+
export declare class ReflectionProbe {
|
|
38
|
+
private readonly device;
|
|
39
|
+
private readonly origin;
|
|
40
|
+
private matrixSnapshot?;
|
|
41
|
+
private readonly capture;
|
|
42
|
+
private readonly depth;
|
|
43
|
+
private readonly targets;
|
|
44
|
+
private readonly views;
|
|
45
|
+
private readonly framebuffers;
|
|
46
|
+
private readonly captureTargets;
|
|
47
|
+
private readonly filterTargets;
|
|
48
|
+
private readonly filter;
|
|
49
|
+
private readonly size;
|
|
50
|
+
private readonly sampleCount;
|
|
51
|
+
private activeSampleCount;
|
|
52
|
+
private readonly budget;
|
|
53
|
+
private readonly maximumFaces;
|
|
54
|
+
private readonly sameFrame;
|
|
55
|
+
private readonly projectionMatrix;
|
|
56
|
+
private readonly pendingFaces;
|
|
57
|
+
private captureCount;
|
|
58
|
+
private filteredCount;
|
|
59
|
+
private front;
|
|
60
|
+
private back;
|
|
61
|
+
private credit;
|
|
62
|
+
private pausedFrames;
|
|
63
|
+
private destroyed;
|
|
64
|
+
constructor(device: Device, props?: ReflectionProbeProps);
|
|
65
|
+
get texture(): Texture | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Record capture and filtering before the main draw. A budget estimate controls work or quality.
|
|
68
|
+
* Returns the number of face work units recorded. Submit the frame before calling again.
|
|
69
|
+
*/
|
|
70
|
+
update(options: ReflectionProbeUpdate): number;
|
|
71
|
+
destroy(): void;
|
|
72
|
+
private nextFace;
|
|
73
|
+
private createCube;
|
|
74
|
+
private createTarget;
|
|
75
|
+
private filterFace;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=reflection-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflection-probe.d.ts","sourceRoot":"","sources":["../../src/lighting/reflection-probe.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,MAAM,EACN,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,OAAO,EAER,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,OAAO,EAAE,KAAK,YAAY,EAAC,MAAM,eAAe,CAAC;AAczD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,wFAAwF;IACxF,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,4FAA4F;IAC5F,QAAQ,EAAE,MAAM,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