|
|
@@ -32,8 +32,8 @@
|
|
|
|
|
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
|
import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
|
|
|
- import { LightProbeGrid } from 'three/addons/lighting/LightProbeGrid.js';
|
|
|
- import { LightProbeGridHelper } from 'three/addons/helpers/LightProbeGridHelper.js';
|
|
|
+ import { LightProbeGridWebGL } from 'three/addons/lighting/LightProbeGridWebGL.js';
|
|
|
+ import { LightProbeGridHelperWebGL } from 'three/addons/helpers/LightProbeGridHelperWebGL.js';
|
|
|
|
|
|
let camera, scene, renderer, controls;
|
|
|
let probesLeft, probesRight;
|
|
|
@@ -279,7 +279,7 @@
|
|
|
resolution: 6
|
|
|
};
|
|
|
|
|
|
- async function bakeWithResolution( resolution ) {
|
|
|
+ async function bake( resolution ) {
|
|
|
|
|
|
// Remove both volumes before baking to prevent feedback
|
|
|
|
|
|
@@ -299,12 +299,12 @@
|
|
|
|
|
|
// Bake both volumes
|
|
|
|
|
|
- probesLeft = new LightProbeGrid( 7.8, 4.7, 7.6, resolution, resolution, resolution );
|
|
|
+ probesLeft = new LightProbeGridWebGL( 7.8, 4.7, 7.6, resolution, resolution, resolution );
|
|
|
probesLeft.position.set( - 3.9, 2.45, 0 );
|
|
|
probesLeft.bake( renderer, scene, { cubemapSize: 32, near: 0.05, far: 20 } );
|
|
|
probesLeft.visible = params.enabled;
|
|
|
|
|
|
- probesRight = new LightProbeGrid( 7.8, 4.7, 7.6, resolution, resolution, resolution );
|
|
|
+ probesRight = new LightProbeGridWebGL( 7.8, 4.7, 7.6, resolution, resolution, resolution );
|
|
|
probesRight.position.set( 3.9, 2.45, 0 );
|
|
|
probesRight.bake( renderer, scene, { cubemapSize: 32, near: 0.05, far: 20 } );
|
|
|
probesRight.visible = params.enabled;
|
|
|
@@ -318,11 +318,11 @@
|
|
|
|
|
|
if ( ! probesHelperLeft ) {
|
|
|
|
|
|
- probesHelperLeft = new LightProbeGridHelper( probesLeft );
|
|
|
+ probesHelperLeft = new LightProbeGridHelperWebGL( probesLeft );
|
|
|
probesHelperLeft.visible = params.showProbes;
|
|
|
scene.add( probesHelperLeft );
|
|
|
|
|
|
- probesHelperRight = new LightProbeGridHelper( probesRight );
|
|
|
+ probesHelperRight = new LightProbeGridHelperWebGL( probesRight );
|
|
|
probesHelperRight.visible = params.showProbes;
|
|
|
scene.add( probesHelperRight );
|
|
|
|
|
|
@@ -338,7 +338,7 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- await bakeWithResolution( params.resolution );
|
|
|
+ await bake( params.resolution );
|
|
|
|
|
|
// GUI
|
|
|
|
|
|
@@ -351,7 +351,7 @@
|
|
|
} );
|
|
|
gui.add( params, 'resolution', 2, 12, 1 ).name( 'Resolution' ).onFinishChange( ( value ) => {
|
|
|
|
|
|
- bakeWithResolution( value );
|
|
|
+ bake( value );
|
|
|
|
|
|
} );
|
|
|
gui.add( params, 'showProbes' ).name( 'Show Probes' ).onChange( ( value ) => {
|