|
|
@@ -24,13 +24,17 @@
|
|
|
import * as THREE from 'three';
|
|
|
import { vec4, color, positionLocal, mix } from 'three/tsl';
|
|
|
|
|
|
- import Stats from 'three/addons/libs/stats.module.js';
|
|
|
+ import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
|
|
|
|
|
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
|
|
|
|
- let container, stats;
|
|
|
+ let container;
|
|
|
let camera, scene, renderer;
|
|
|
|
|
|
+ const params = {
|
|
|
+ intensity: 1
|
|
|
+ };
|
|
|
+
|
|
|
init();
|
|
|
|
|
|
async function init() {
|
|
|
@@ -93,10 +97,20 @@
|
|
|
controls.maxPolarAngle = 0.9 * Math.PI / 2;
|
|
|
controls.enableZoom = false;
|
|
|
|
|
|
- // STATS
|
|
|
+ // GUI
|
|
|
+
|
|
|
+ const gui = new GUI();
|
|
|
+
|
|
|
+ gui.add( params, 'intensity', 0, 1 ).name( 'Light Map Intensity' ).onChange( ( value ) => {
|
|
|
+
|
|
|
+ for ( const material of object.material ) {
|
|
|
+
|
|
|
+ material.lightMapIntensity = value;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- stats = new Stats();
|
|
|
- container.appendChild( stats.dom );
|
|
|
+ } );
|
|
|
+ gui.open();
|
|
|
|
|
|
//
|
|
|
|
|
|
@@ -118,7 +132,6 @@
|
|
|
function animate() {
|
|
|
|
|
|
renderer.render( scene, camera );
|
|
|
- stats.update();
|
|
|
|
|
|
}
|
|
|
|