rayzee 4.8.10 → 4.8.12
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/README.md +160 -74
- package/dist/rayzee.es.js +423 -115
- package/dist/rayzee.es.js.map +1 -1
- package/dist/rayzee.umd.js +1 -1
- package/dist/rayzee.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/Passes/OIDNDenoiser.js +54 -17
- package/src/PathTracerApp.js +179 -27
- package/src/api/AnimationAPI.js +87 -0
- package/src/api/CameraAPI.js +109 -0
- package/src/api/DenoisingAPI.js +243 -0
- package/src/api/EnvironmentAPI.js +106 -0
- package/src/api/LightsAPI.js +80 -0
- package/src/api/MaterialsAPI.js +73 -0
- package/src/api/OutputAPI.js +90 -0
- package/src/api/SelectionAPI.js +89 -0
- package/src/api/TransformAPI.js +49 -0
- package/src/api/index.js +16 -0
- package/src/index.js +13 -0
package/src/PathTracerApp.js
CHANGED
|
@@ -27,6 +27,17 @@ import { EngineEvents } from './EngineEvents.js';
|
|
|
27
27
|
import { AssetLoader } from './Processor/AssetLoader.js';
|
|
28
28
|
import { SceneProcessor } from './Processor/SceneProcessor.js';
|
|
29
29
|
|
|
30
|
+
// Sub-API facades
|
|
31
|
+
import { OutputAPI } from './api/OutputAPI.js';
|
|
32
|
+
import { LightsAPI } from './api/LightsAPI.js';
|
|
33
|
+
import { AnimationAPI } from './api/AnimationAPI.js';
|
|
34
|
+
import { SelectionAPI } from './api/SelectionAPI.js';
|
|
35
|
+
import { TransformAPI } from './api/TransformAPI.js';
|
|
36
|
+
import { CameraAPI } from './api/CameraAPI.js';
|
|
37
|
+
import { EnvironmentAPI } from './api/EnvironmentAPI.js';
|
|
38
|
+
import { MaterialsAPI } from './api/MaterialsAPI.js';
|
|
39
|
+
import { DenoisingAPI } from './api/DenoisingAPI.js';
|
|
40
|
+
|
|
30
41
|
// Managers
|
|
31
42
|
import { RenderSettings } from './RenderSettings.js';
|
|
32
43
|
import { CameraManager } from './managers/CameraManager.js';
|
|
@@ -120,6 +131,17 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
120
131
|
this._lastRenderHeight = 0;
|
|
121
132
|
this._resizeDebounceTimer = null;
|
|
122
133
|
|
|
134
|
+
// ── Sub-API facade instances (lazily created via getters) ──
|
|
135
|
+
this._outputAPI = null;
|
|
136
|
+
this._lightsAPI = null;
|
|
137
|
+
this._animationAPI = null;
|
|
138
|
+
this._selectionAPI = null;
|
|
139
|
+
this._transformAPI = null;
|
|
140
|
+
this._cameraAPI = null;
|
|
141
|
+
this._environmentAPI = null;
|
|
142
|
+
this._materialsAPI = null;
|
|
143
|
+
this._denoisingAPI = null;
|
|
144
|
+
|
|
123
145
|
}
|
|
124
146
|
|
|
125
147
|
// ═══════════════════════════════════════════════════════════════
|
|
@@ -172,6 +194,82 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
172
194
|
|
|
173
195
|
}
|
|
174
196
|
|
|
197
|
+
// ═══════════════════════════════════════════════════════════════
|
|
198
|
+
// Sub-API Facades — namespaced access to grouped functionality
|
|
199
|
+
// ═══════════════════════════════════════════════════════════════
|
|
200
|
+
|
|
201
|
+
/** Canvas output, screenshots, resize, and scene statistics. */
|
|
202
|
+
get output() {
|
|
203
|
+
|
|
204
|
+
if ( ! this._outputAPI ) this._outputAPI = new OutputAPI( this );
|
|
205
|
+
return this._outputAPI;
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Light CRUD, helpers, and GPU sync. */
|
|
210
|
+
get lights() {
|
|
211
|
+
|
|
212
|
+
if ( ! this._lightsAPI ) this._lightsAPI = new LightsAPI( this );
|
|
213
|
+
return this._lightsAPI;
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Animation playback controls. */
|
|
218
|
+
get animation() {
|
|
219
|
+
|
|
220
|
+
if ( ! this._animationAPI ) this._animationAPI = new AnimationAPI( this );
|
|
221
|
+
return this._animationAPI;
|
|
222
|
+
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** Object selection and interaction modes. */
|
|
226
|
+
get selection() {
|
|
227
|
+
|
|
228
|
+
if ( ! this._selectionAPI ) this._selectionAPI = new SelectionAPI( this );
|
|
229
|
+
return this._selectionAPI;
|
|
230
|
+
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** Transform gizmo mode and space. */
|
|
234
|
+
get transform() {
|
|
235
|
+
|
|
236
|
+
if ( ! this._transformAPI ) this._transformAPI = new TransformAPI( this );
|
|
237
|
+
return this._transformAPI;
|
|
238
|
+
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Camera switching, auto-focus, and DOF — also exposes raw Three.js objects via .active and .controls. */
|
|
242
|
+
get camera() {
|
|
243
|
+
|
|
244
|
+
if ( ! this._cameraAPI ) this._cameraAPI = new CameraAPI( this );
|
|
245
|
+
return this._cameraAPI;
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Environment maps, sky modes, and procedural generation. */
|
|
250
|
+
get environment() {
|
|
251
|
+
|
|
252
|
+
if ( ! this._environmentAPI ) this._environmentAPI = new EnvironmentAPI( this );
|
|
253
|
+
return this._environmentAPI;
|
|
254
|
+
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** Material property updates and texture transforms. */
|
|
258
|
+
get materials() {
|
|
259
|
+
|
|
260
|
+
if ( ! this._materialsAPI ) this._materialsAPI = new MaterialsAPI( this );
|
|
261
|
+
return this._materialsAPI;
|
|
262
|
+
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Denoiser strategy, ASVGF, OIDN, upscaler, adaptive sampling, and auto-exposure. */
|
|
266
|
+
get denoising() {
|
|
267
|
+
|
|
268
|
+
if ( ! this._denoisingAPI ) this._denoisingAPI = new DenoisingAPI( this );
|
|
269
|
+
return this._denoisingAPI;
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
|
|
175
273
|
// ═══════════════════════════════════════════════════════════════
|
|
176
274
|
// Lifecycle
|
|
177
275
|
// ═══════════════════════════════════════════════════════════════
|
|
@@ -1017,6 +1115,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1017
1115
|
* Start playing a GLTF animation clip.
|
|
1018
1116
|
* @param {number} [clipIndex=0] - Clip index, or -1 to play all
|
|
1019
1117
|
*/
|
|
1118
|
+
/** @internal Use engine.animation.play() */
|
|
1020
1119
|
playAnimation( clipIndex = 0 ) {
|
|
1021
1120
|
|
|
1022
1121
|
if ( ! this.animationManager?.hasAnimations ) {
|
|
@@ -1033,6 +1132,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1033
1132
|
}
|
|
1034
1133
|
|
|
1035
1134
|
/**
|
|
1135
|
+
* @internal Use engine.animation.pause()
|
|
1036
1136
|
* Pause animation — preserves current time position.
|
|
1037
1137
|
*/
|
|
1038
1138
|
pauseAnimation() {
|
|
@@ -1044,7 +1144,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1044
1144
|
}
|
|
1045
1145
|
|
|
1046
1146
|
/**
|
|
1047
|
-
*
|
|
1147
|
+
* @internal Use engine.animation.resume()
|
|
1048
1148
|
*/
|
|
1049
1149
|
resumeAnimation() {
|
|
1050
1150
|
|
|
@@ -1055,7 +1155,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1055
1155
|
}
|
|
1056
1156
|
|
|
1057
1157
|
/**
|
|
1058
|
-
*
|
|
1158
|
+
* @internal Use engine.animation.stop()
|
|
1059
1159
|
*/
|
|
1060
1160
|
stopAnimationPlayback() {
|
|
1061
1161
|
|
|
@@ -1066,8 +1166,8 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1066
1166
|
}
|
|
1067
1167
|
|
|
1068
1168
|
/**
|
|
1069
|
-
*
|
|
1070
|
-
* @param {number} speed
|
|
1169
|
+
* @internal Use engine.animation.setSpeed()
|
|
1170
|
+
* @param {number} speed
|
|
1071
1171
|
*/
|
|
1072
1172
|
setAnimationSpeed( speed ) {
|
|
1073
1173
|
|
|
@@ -1076,8 +1176,8 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1076
1176
|
}
|
|
1077
1177
|
|
|
1078
1178
|
/**
|
|
1079
|
-
*
|
|
1080
|
-
* @param {boolean} loop
|
|
1179
|
+
* @internal Use engine.animation.setLoop()
|
|
1180
|
+
* @param {boolean} loop
|
|
1081
1181
|
*/
|
|
1082
1182
|
setAnimationLoop( loop ) {
|
|
1083
1183
|
|
|
@@ -1086,7 +1186,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1086
1186
|
}
|
|
1087
1187
|
|
|
1088
1188
|
/**
|
|
1089
|
-
*
|
|
1189
|
+
* @internal Use engine.animation.clips
|
|
1090
1190
|
* @returns {{ index: number, name: string, duration: number }[]}
|
|
1091
1191
|
*/
|
|
1092
1192
|
get animationClips() {
|
|
@@ -1099,6 +1199,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1099
1199
|
// Resize
|
|
1100
1200
|
// ═══════════════════════════════════════════════════════════════
|
|
1101
1201
|
|
|
1202
|
+
/** @internal Use engine.output.resize() */
|
|
1102
1203
|
onResize() {
|
|
1103
1204
|
|
|
1104
1205
|
const width = this.canvas.clientWidth;
|
|
@@ -1149,6 +1250,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1149
1250
|
|
|
1150
1251
|
}
|
|
1151
1252
|
|
|
1253
|
+
/** @internal Use engine.output.setSize() */
|
|
1152
1254
|
setCanvasSize( width, height ) {
|
|
1153
1255
|
|
|
1154
1256
|
this.canvas.style.width = `${width}px`;
|
|
@@ -1242,6 +1344,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1242
1344
|
// Delegated APIs — Camera
|
|
1243
1345
|
// ═══════════════════════════════════════════════════════════════
|
|
1244
1346
|
|
|
1347
|
+
/** @internal Use engine.cameraAPI.switch() */
|
|
1245
1348
|
switchCamera( index ) {
|
|
1246
1349
|
|
|
1247
1350
|
this.cameraManager.switchCamera(
|
|
@@ -1253,6 +1356,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1253
1356
|
|
|
1254
1357
|
}
|
|
1255
1358
|
|
|
1359
|
+
/** @internal Use engine.cameraAPI.getNames() */
|
|
1256
1360
|
getCameraNames() {
|
|
1257
1361
|
|
|
1258
1362
|
return this.cameraManager.getCameraNames();
|
|
@@ -1263,6 +1367,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1263
1367
|
// Delegated APIs — Lights
|
|
1264
1368
|
// ═══════════════════════════════════════════════════════════════
|
|
1265
1369
|
|
|
1370
|
+
/** @internal Use engine.lights.add() */
|
|
1266
1371
|
addLight( type ) {
|
|
1267
1372
|
|
|
1268
1373
|
const descriptor = this.lightManager.addLight( type );
|
|
@@ -1271,6 +1376,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1271
1376
|
|
|
1272
1377
|
}
|
|
1273
1378
|
|
|
1379
|
+
/** @internal Use engine.lights.remove() */
|
|
1274
1380
|
removeLight( uuid ) {
|
|
1275
1381
|
|
|
1276
1382
|
const removed = this.lightManager.removeLight( uuid );
|
|
@@ -1279,6 +1385,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1279
1385
|
|
|
1280
1386
|
}
|
|
1281
1387
|
|
|
1388
|
+
/** @internal Use engine.lights.clear() */
|
|
1282
1389
|
clearLights() {
|
|
1283
1390
|
|
|
1284
1391
|
this.lightManager.clearLights();
|
|
@@ -1286,18 +1393,21 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1286
1393
|
|
|
1287
1394
|
}
|
|
1288
1395
|
|
|
1396
|
+
/** @internal Use engine.lights.getAll() */
|
|
1289
1397
|
getLights() {
|
|
1290
1398
|
|
|
1291
1399
|
return this.lightManager.getLights();
|
|
1292
1400
|
|
|
1293
1401
|
}
|
|
1294
1402
|
|
|
1403
|
+
/** @internal Use engine.lights.sync() */
|
|
1295
1404
|
updateLights() {
|
|
1296
1405
|
|
|
1297
1406
|
this.lightManager.updateLights();
|
|
1298
1407
|
|
|
1299
1408
|
}
|
|
1300
1409
|
|
|
1410
|
+
/** @internal Use engine.lights.showHelpers() */
|
|
1301
1411
|
setShowLightHelper( show ) {
|
|
1302
1412
|
|
|
1303
1413
|
this.lightManager.setShowLightHelper( show );
|
|
@@ -1308,6 +1418,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1308
1418
|
// Delegated APIs — Denoiser
|
|
1309
1419
|
// ═══════════════════════════════════════════════════════════════
|
|
1310
1420
|
|
|
1421
|
+
/** @internal Use engine.denoising.setStrategy() */
|
|
1311
1422
|
setDenoiserStrategy( strategy, asvgfPreset ) {
|
|
1312
1423
|
|
|
1313
1424
|
this.denoisingManager.setDenoiserStrategy( strategy, asvgfPreset );
|
|
@@ -1315,6 +1426,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1315
1426
|
|
|
1316
1427
|
}
|
|
1317
1428
|
|
|
1429
|
+
/** @internal Use engine.denoising.setASVGFEnabled() */
|
|
1318
1430
|
setASVGFEnabled( enabled, qualityPreset ) {
|
|
1319
1431
|
|
|
1320
1432
|
this.denoisingManager.setASVGFEnabled( enabled, qualityPreset );
|
|
@@ -1322,6 +1434,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1322
1434
|
|
|
1323
1435
|
}
|
|
1324
1436
|
|
|
1437
|
+
/** @internal Use engine.denoising.applyASVGFPreset() */
|
|
1325
1438
|
applyASVGFPreset( presetName ) {
|
|
1326
1439
|
|
|
1327
1440
|
this.denoisingManager.applyASVGFPreset( presetName );
|
|
@@ -1329,6 +1442,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1329
1442
|
|
|
1330
1443
|
}
|
|
1331
1444
|
|
|
1445
|
+
/** @internal Use engine.denoising.setAutoExposure() */
|
|
1332
1446
|
setAutoExposureEnabled( enabled ) {
|
|
1333
1447
|
|
|
1334
1448
|
this.denoisingManager.setAutoExposureEnabled( enabled, this.settings.get( 'exposure' ) );
|
|
@@ -1336,6 +1450,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1336
1450
|
|
|
1337
1451
|
}
|
|
1338
1452
|
|
|
1453
|
+
/** @internal Use engine.denoising.setAdaptiveSampling() */
|
|
1339
1454
|
setAdaptiveSamplingEnabled( enabled ) {
|
|
1340
1455
|
|
|
1341
1456
|
this.settings.set( 'useAdaptiveSampling', enabled );
|
|
@@ -1347,6 +1462,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1347
1462
|
// Delegated APIs — Interaction
|
|
1348
1463
|
// ═══════════════════════════════════════════════════════════════
|
|
1349
1464
|
|
|
1465
|
+
/** @internal Use engine.selection.select() */
|
|
1350
1466
|
selectObject( object ) {
|
|
1351
1467
|
|
|
1352
1468
|
const outlineHelper = this.overlayManager?.getHelper( 'outline' );
|
|
@@ -1381,6 +1497,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1381
1497
|
|
|
1382
1498
|
}
|
|
1383
1499
|
|
|
1500
|
+
/** @internal Use engine.selection.toggleFocusMode() */
|
|
1384
1501
|
toggleFocusMode() {
|
|
1385
1502
|
|
|
1386
1503
|
if ( ! this._interactionManager ) return false;
|
|
@@ -1390,6 +1507,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1390
1507
|
|
|
1391
1508
|
}
|
|
1392
1509
|
|
|
1510
|
+
/** @internal Use engine.selection.toggleMode() */
|
|
1393
1511
|
toggleSelectMode() {
|
|
1394
1512
|
|
|
1395
1513
|
if ( ! this._interactionManager ) return false;
|
|
@@ -1397,6 +1515,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1397
1515
|
|
|
1398
1516
|
}
|
|
1399
1517
|
|
|
1518
|
+
/** @internal Use engine.selection.disableMode() */
|
|
1400
1519
|
disableSelectMode() {
|
|
1401
1520
|
|
|
1402
1521
|
this._interactionManager?.disableSelectMode();
|
|
@@ -1408,6 +1527,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1408
1527
|
// Delegated APIs — Transform
|
|
1409
1528
|
// ═══════════════════════════════════════════════════════════════
|
|
1410
1529
|
|
|
1530
|
+
/** @internal Use engine.transform.setMode() */
|
|
1411
1531
|
setTransformMode( mode ) {
|
|
1412
1532
|
|
|
1413
1533
|
this._transformManager?.setMode( mode );
|
|
@@ -1415,12 +1535,14 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1415
1535
|
|
|
1416
1536
|
}
|
|
1417
1537
|
|
|
1538
|
+
/** @internal Use engine.transform.setSpace() */
|
|
1418
1539
|
setTransformSpace( space ) {
|
|
1419
1540
|
|
|
1420
1541
|
this._transformManager?.setSpace( space );
|
|
1421
1542
|
|
|
1422
1543
|
}
|
|
1423
1544
|
|
|
1545
|
+
/** @internal Use engine.transform.manager */
|
|
1424
1546
|
get transformManager() {
|
|
1425
1547
|
|
|
1426
1548
|
return this._transformManager;
|
|
@@ -1438,42 +1560,49 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1438
1560
|
// Delegated APIs — Environment
|
|
1439
1561
|
// ═══════════════════════════════════════════════════════════════
|
|
1440
1562
|
|
|
1563
|
+
/** @internal Use engine.environment.params */
|
|
1441
1564
|
getEnvParams() {
|
|
1442
1565
|
|
|
1443
1566
|
return this.stages.pathTracer?.environment?.envParams ?? null;
|
|
1444
1567
|
|
|
1445
1568
|
}
|
|
1446
1569
|
|
|
1570
|
+
/** @internal Use engine.environment.texture */
|
|
1447
1571
|
getEnvironmentTexture() {
|
|
1448
1572
|
|
|
1449
1573
|
return this.stages.pathTracer?.environment?.environmentTexture ?? null;
|
|
1450
1574
|
|
|
1451
1575
|
}
|
|
1452
1576
|
|
|
1577
|
+
/** @internal */
|
|
1453
1578
|
getEnvironmentCDF() {
|
|
1454
1579
|
|
|
1455
1580
|
return null;
|
|
1456
1581
|
|
|
1457
1582
|
}
|
|
1458
1583
|
|
|
1584
|
+
/** @internal Use engine.environment.generateProcedural() */
|
|
1459
1585
|
async generateProceduralSkyTexture() {
|
|
1460
1586
|
|
|
1461
1587
|
return this.stages.pathTracer?.environment.generateProceduralSkyTexture();
|
|
1462
1588
|
|
|
1463
1589
|
}
|
|
1464
1590
|
|
|
1591
|
+
/** @internal Use engine.environment.generateGradient() */
|
|
1465
1592
|
async generateGradientTexture() {
|
|
1466
1593
|
|
|
1467
1594
|
return this.stages.pathTracer?.environment.generateGradientTexture();
|
|
1468
1595
|
|
|
1469
1596
|
}
|
|
1470
1597
|
|
|
1598
|
+
/** @internal Use engine.environment.generateSolid() */
|
|
1471
1599
|
async generateSolidColorTexture() {
|
|
1472
1600
|
|
|
1473
1601
|
return this.stages.pathTracer?.environment.generateSolidColorTexture();
|
|
1474
1602
|
|
|
1475
1603
|
}
|
|
1476
1604
|
|
|
1605
|
+
/** @internal Use engine.environment.setTexture() */
|
|
1477
1606
|
async setEnvironmentMap( texture ) {
|
|
1478
1607
|
|
|
1479
1608
|
if ( ! this.stages.pathTracer ) {
|
|
@@ -1488,6 +1617,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1488
1617
|
|
|
1489
1618
|
}
|
|
1490
1619
|
|
|
1620
|
+
/** @internal Use engine.environment.markDirty() */
|
|
1491
1621
|
markEnvironmentNeedsUpdate() {
|
|
1492
1622
|
|
|
1493
1623
|
const tex = this.stages.pathTracer?.environment?.environmentTexture;
|
|
@@ -1495,6 +1625,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1495
1625
|
|
|
1496
1626
|
}
|
|
1497
1627
|
|
|
1628
|
+
/** @internal Use engine.environment.setMode() */
|
|
1498
1629
|
async setEnvironmentMode( mode ) {
|
|
1499
1630
|
|
|
1500
1631
|
const previousMode = this._environmentMode || 'hdri';
|
|
@@ -1544,31 +1675,31 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1544
1675
|
// Read-Only Accessors
|
|
1545
1676
|
// ═══════════════════════════════════════════════════════════════
|
|
1546
1677
|
|
|
1678
|
+
/** @internal Use engine.output.isComplete() */
|
|
1547
1679
|
isComplete() {
|
|
1548
1680
|
|
|
1549
1681
|
return this.stages.pathTracer?.isComplete ?? false;
|
|
1550
1682
|
|
|
1551
1683
|
}
|
|
1552
1684
|
|
|
1685
|
+
/** @internal Use engine.output.getFrameCount() */
|
|
1553
1686
|
getFrameCount() {
|
|
1554
1687
|
|
|
1555
1688
|
return this.stages.pathTracer?.frameCount || 0;
|
|
1556
1689
|
|
|
1557
1690
|
}
|
|
1558
1691
|
|
|
1559
|
-
/**
|
|
1560
|
-
|
|
1692
|
+
/**
|
|
1693
|
+
* Convenience alias for the raw Three.js PerspectiveCamera.
|
|
1694
|
+
* Prefer engine.camera.active for consistency with the sub-API pattern.
|
|
1695
|
+
*/
|
|
1696
|
+
get activeCamera() {
|
|
1561
1697
|
|
|
1562
1698
|
return this.cameraManager?.camera ?? this._camera;
|
|
1563
1699
|
|
|
1564
1700
|
}
|
|
1565
1701
|
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
return this.cameraManager?.controls ?? this._controls;
|
|
1569
|
-
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1702
|
+
/** @internal Use engine.output.getStatistics() */
|
|
1572
1703
|
getSceneStatistics() {
|
|
1573
1704
|
|
|
1574
1705
|
try {
|
|
@@ -1584,6 +1715,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1584
1715
|
}
|
|
1585
1716
|
|
|
1586
1717
|
/**
|
|
1718
|
+
* @internal Use engine.output.getCanvas()
|
|
1587
1719
|
* Returns the canvas element suitable for reading pixels from.
|
|
1588
1720
|
* Ensures the WebGPU canvas has fresh content if it's the source.
|
|
1589
1721
|
* Use this instead of directly accessing renderer.domElement / denoiserCanvas.
|
|
@@ -1613,8 +1745,8 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1613
1745
|
}
|
|
1614
1746
|
|
|
1615
1747
|
/**
|
|
1616
|
-
*
|
|
1617
|
-
* @param {import('three').Vector3} center
|
|
1748
|
+
* @internal Use engine.cameraAPI.focusOn()
|
|
1749
|
+
* @param {import('three').Vector3} center
|
|
1618
1750
|
*/
|
|
1619
1751
|
focusOnPoint( center ) {
|
|
1620
1752
|
|
|
@@ -1626,7 +1758,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1626
1758
|
}
|
|
1627
1759
|
|
|
1628
1760
|
/**
|
|
1629
|
-
*
|
|
1761
|
+
* @internal Use engine.selection.dispatchEvent()
|
|
1630
1762
|
* @param {Object} event
|
|
1631
1763
|
*/
|
|
1632
1764
|
dispatchInteractionEvent( event ) {
|
|
@@ -1636,7 +1768,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1636
1768
|
}
|
|
1637
1769
|
|
|
1638
1770
|
/**
|
|
1639
|
-
*
|
|
1771
|
+
* @internal Use engine.selection.on()
|
|
1640
1772
|
* @param {string} type
|
|
1641
1773
|
* @param {Function} handler
|
|
1642
1774
|
* @returns {Function} unsubscribe function
|
|
@@ -1648,6 +1780,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1648
1780
|
|
|
1649
1781
|
}
|
|
1650
1782
|
|
|
1783
|
+
/** @internal Use engine.output.screenshot() */
|
|
1651
1784
|
takeScreenshot() {
|
|
1652
1785
|
|
|
1653
1786
|
const canvas = this.getOutputCanvas();
|
|
@@ -1695,6 +1828,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1695
1828
|
|
|
1696
1829
|
}
|
|
1697
1830
|
|
|
1831
|
+
/** @internal Use engine.denoising.setAdaptiveSamplingParams() */
|
|
1698
1832
|
setAdaptiveSamplingParameters( params ) {
|
|
1699
1833
|
|
|
1700
1834
|
if ( params.min !== undefined ) this.stages.pathTracer?.setAdaptiveSamplingMin( params.min );
|
|
@@ -1703,6 +1837,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1703
1837
|
|
|
1704
1838
|
}
|
|
1705
1839
|
|
|
1840
|
+
/** @internal Use engine.materials.setProperty() */
|
|
1706
1841
|
updateMaterialProperty( materialIndex, property, value ) {
|
|
1707
1842
|
|
|
1708
1843
|
this.stages.pathTracer?.materialData.updateMaterialProperty( materialIndex, property, value );
|
|
@@ -1743,6 +1878,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1743
1878
|
|
|
1744
1879
|
}
|
|
1745
1880
|
|
|
1881
|
+
/** @internal Use engine.materials.setTextureTransform() */
|
|
1746
1882
|
updateTextureTransform( materialIndex, textureName, transform ) {
|
|
1747
1883
|
|
|
1748
1884
|
this.stages.pathTracer?.materialData.updateTextureTransform( materialIndex, textureName, transform );
|
|
@@ -1750,18 +1886,21 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1750
1886
|
|
|
1751
1887
|
}
|
|
1752
1888
|
|
|
1889
|
+
/** @internal Use engine.materials.refresh() */
|
|
1753
1890
|
refreshMaterial() {
|
|
1754
1891
|
|
|
1755
1892
|
this.reset();
|
|
1756
1893
|
|
|
1757
1894
|
}
|
|
1758
1895
|
|
|
1896
|
+
/** @internal Use engine.materials.replace() */
|
|
1759
1897
|
updateMaterial( materialIndex, material ) {
|
|
1760
1898
|
|
|
1761
1899
|
this.stages.pathTracer?.materialData.updateMaterial( materialIndex, material );
|
|
1762
1900
|
|
|
1763
1901
|
}
|
|
1764
1902
|
|
|
1903
|
+
/** @internal Use engine.materials.rebuild() */
|
|
1765
1904
|
async rebuildMaterials( scene ) {
|
|
1766
1905
|
|
|
1767
1906
|
await this.stages.pathTracer?.rebuildMaterials( scene || this.meshScene );
|
|
@@ -1774,14 +1913,14 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1774
1913
|
|
|
1775
1914
|
// ── ASVGF ──
|
|
1776
1915
|
|
|
1777
|
-
/**
|
|
1916
|
+
/** @internal Use engine.denoising.setASVGFParams() */
|
|
1778
1917
|
updateASVGFParameters( params ) {
|
|
1779
1918
|
|
|
1780
1919
|
this.stages.asvgf?.updateParameters( params );
|
|
1781
1920
|
|
|
1782
1921
|
}
|
|
1783
1922
|
|
|
1784
|
-
/**
|
|
1923
|
+
/** @internal Use engine.denoising.toggleASVGFHeatmap() */
|
|
1785
1924
|
toggleASVGFHeatmap( enabled ) {
|
|
1786
1925
|
|
|
1787
1926
|
this.stages.asvgf?.toggleHeatmap?.( enabled );
|
|
@@ -1789,8 +1928,8 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1789
1928
|
}
|
|
1790
1929
|
|
|
1791
1930
|
/**
|
|
1792
|
-
*
|
|
1793
|
-
* @param {Object} config
|
|
1931
|
+
* @internal Use engine.denoising.configureASVGFForMode()
|
|
1932
|
+
* @param {Object} config
|
|
1794
1933
|
*/
|
|
1795
1934
|
configureASVGFForMode( config ) {
|
|
1796
1935
|
|
|
@@ -1810,7 +1949,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1810
1949
|
|
|
1811
1950
|
// ── SSRC ──
|
|
1812
1951
|
|
|
1813
|
-
/**
|
|
1952
|
+
/** @internal Use engine.denoising.setSSRCParams() */
|
|
1814
1953
|
updateSSRCParameters( params ) {
|
|
1815
1954
|
|
|
1816
1955
|
this.stages.ssrc?.updateParameters( params );
|
|
@@ -1819,7 +1958,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1819
1958
|
|
|
1820
1959
|
// ── EdgeAware Filtering ──
|
|
1821
1960
|
|
|
1822
|
-
/**
|
|
1961
|
+
/** @internal Use engine.denoising.setEdgeAwareParams() */
|
|
1823
1962
|
updateEdgeAwareUniforms( params ) {
|
|
1824
1963
|
|
|
1825
1964
|
this.stages.edgeFilter?.updateUniforms( params );
|
|
@@ -1828,7 +1967,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1828
1967
|
|
|
1829
1968
|
// ── Auto Exposure ──
|
|
1830
1969
|
|
|
1831
|
-
/**
|
|
1970
|
+
/** @internal Use engine.denoising.setAutoExposureParams() */
|
|
1832
1971
|
updateAutoExposureParameters( params ) {
|
|
1833
1972
|
|
|
1834
1973
|
this.stages.autoExposure?.updateParameters( params );
|
|
@@ -1837,37 +1976,42 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1837
1976
|
|
|
1838
1977
|
// ── Adaptive Sampling ──
|
|
1839
1978
|
|
|
1840
|
-
/**
|
|
1979
|
+
/** @internal Use engine.denoising.setAdaptiveSamplingParams() */
|
|
1841
1980
|
updateAdaptiveSamplingParameters( params ) {
|
|
1842
1981
|
|
|
1843
1982
|
this.stages.adaptiveSampling?.setAdaptiveSamplingParameters( params );
|
|
1844
1983
|
|
|
1845
1984
|
}
|
|
1846
1985
|
|
|
1986
|
+
/** @internal Use engine.denoising.setAdaptiveSamplingParams({ varianceThreshold }) */
|
|
1847
1987
|
setAdaptiveSamplingVarianceThreshold( v ) {
|
|
1848
1988
|
|
|
1849
1989
|
this.stages.adaptiveSampling?.setVarianceThreshold( v );
|
|
1850
1990
|
|
|
1851
1991
|
}
|
|
1852
1992
|
|
|
1993
|
+
/** @internal Use engine.denoising.setAdaptiveSamplingParams({ materialBias }) */
|
|
1853
1994
|
setAdaptiveSamplingMaterialBias( v ) {
|
|
1854
1995
|
|
|
1855
1996
|
this.stages.adaptiveSampling?.setMaterialBias( v );
|
|
1856
1997
|
|
|
1857
1998
|
}
|
|
1858
1999
|
|
|
2000
|
+
/** @internal Use engine.denoising.setAdaptiveSamplingParams({ edgeBias }) */
|
|
1859
2001
|
setAdaptiveSamplingEdgeBias( v ) {
|
|
1860
2002
|
|
|
1861
2003
|
this.stages.adaptiveSampling?.setEdgeBias( v );
|
|
1862
2004
|
|
|
1863
2005
|
}
|
|
1864
2006
|
|
|
2007
|
+
/** @internal Use engine.denoising.setAdaptiveSamplingParams({ convergenceSpeed }) */
|
|
1865
2008
|
setAdaptiveSamplingConvergenceSpeed( v ) {
|
|
1866
2009
|
|
|
1867
2010
|
this.stages.adaptiveSampling?.setConvergenceSpeed( v );
|
|
1868
2011
|
|
|
1869
2012
|
}
|
|
1870
2013
|
|
|
2014
|
+
/** @internal Use engine.denoising.toggleAdaptiveSamplingHelper() */
|
|
1871
2015
|
toggleAdaptiveSamplingHelper( enabled ) {
|
|
1872
2016
|
|
|
1873
2017
|
this.stages.adaptiveSampling?.toggleHelper( enabled );
|
|
@@ -1876,6 +2020,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1876
2020
|
|
|
1877
2021
|
// ── Tile Highlight ──
|
|
1878
2022
|
|
|
2023
|
+
/** @internal Use engine.denoising.setTileHighlightEnabled() */
|
|
1879
2024
|
setTileHighlightEnabled( enabled ) {
|
|
1880
2025
|
|
|
1881
2026
|
this.setTileHelperEnabled( enabled );
|
|
@@ -1884,6 +2029,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1884
2029
|
|
|
1885
2030
|
// ── OIDN Denoiser ──
|
|
1886
2031
|
|
|
2032
|
+
/** @internal Use engine.denoising.setOIDNEnabled() */
|
|
1887
2033
|
setOIDNEnabled( enabled ) {
|
|
1888
2034
|
|
|
1889
2035
|
const d = this.denoisingManager?.denoiser;
|
|
@@ -1891,18 +2037,21 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1891
2037
|
|
|
1892
2038
|
}
|
|
1893
2039
|
|
|
2040
|
+
/** @internal Use engine.denoising.setOIDNQuality() */
|
|
1894
2041
|
updateOIDNQuality( quality ) {
|
|
1895
2042
|
|
|
1896
2043
|
this.denoisingManager?.denoiser?.updateQuality( quality );
|
|
1897
2044
|
|
|
1898
2045
|
}
|
|
1899
2046
|
|
|
2047
|
+
/** @internal Use engine.denoising.setOIDNTileHelper() */
|
|
1900
2048
|
setOIDNTileHelper( enabled ) {
|
|
1901
2049
|
|
|
1902
2050
|
this.setTileHelperEnabled( enabled );
|
|
1903
2051
|
|
|
1904
2052
|
}
|
|
1905
2053
|
|
|
2054
|
+
/** @internal Use engine.denoising.setTileHelperEnabled() */
|
|
1906
2055
|
setTileHelperEnabled( enabled ) {
|
|
1907
2056
|
|
|
1908
2057
|
const tileHelper = this.overlayManager?.getHelper( 'tiles' );
|
|
@@ -1917,6 +2066,7 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1917
2066
|
|
|
1918
2067
|
// ── AI Upscaler ──
|
|
1919
2068
|
|
|
2069
|
+
/** @internal Use engine.denoising.setUpscalerEnabled() */
|
|
1920
2070
|
setUpscalerEnabled( enabled ) {
|
|
1921
2071
|
|
|
1922
2072
|
const u = this.denoisingManager?.upscaler;
|
|
@@ -1924,12 +2074,14 @@ export class PathTracerApp extends EventDispatcher {
|
|
|
1924
2074
|
|
|
1925
2075
|
}
|
|
1926
2076
|
|
|
2077
|
+
/** @internal Use engine.denoising.setUpscalerScaleFactor() */
|
|
1927
2078
|
setUpscalerScaleFactor( factor ) {
|
|
1928
2079
|
|
|
1929
2080
|
this.denoisingManager?.upscaler?.setScaleFactor( factor );
|
|
1930
2081
|
|
|
1931
2082
|
}
|
|
1932
2083
|
|
|
2084
|
+
/** @internal Use engine.denoising.setUpscalerQuality() */
|
|
1933
2085
|
setUpscalerQuality( quality ) {
|
|
1934
2086
|
|
|
1935
2087
|
this.denoisingManager?.upscaler?.setQuality( quality );
|