Browse Source

Simplified LightProbe example.

Mr.doob 6 years ago
parent
commit
a2bb5c1873
1 changed files with 3 additions and 12 deletions
  1. 3 12
      examples/webgl_lightprobe.html

+ 3 - 12
examples/webgl_lightprobe.html

@@ -55,14 +55,12 @@
 
 
 			var gui;
 			var gui;
 
 
-			var ambientLight;
 			var lightProbe;
 			var lightProbe;
 			var directionalLight;
 			var directionalLight;
 
 
 			// linear color space
 			// linear color space
 			var API = {
 			var API = {
-				ambientLightIntensity: 0.0,
-				lightProbeIntensity: 0.3,
+				lightProbeIntensity: 1.0,
 				directionalLightIntensity: 0.2,
 				directionalLightIntensity: 0.2,
 				envMapIntensity: 1
 				envMapIntensity: 1
 			};
 			};
@@ -90,7 +88,7 @@
 
 
 				// camera
 				// camera
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 1000 );
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 1000 );
-				camera.position.set( - 15, 0, 20 );
+				camera.position.set( 0, 0, 30 );
 
 
 				// controls
 				// controls
 				var controls = new THREE.OrbitControls( camera, renderer.domElement );
 				var controls = new THREE.OrbitControls( camera, renderer.domElement );
@@ -99,10 +97,6 @@
 				controls.maxDistance = 50;
 				controls.maxDistance = 50;
 				controls.enablePan = false;
 				controls.enablePan = false;
 
 
-				// ambient
-				ambientLight = new THREE.AmbientLight( 0xffffff, API.ambientLightIntensity );
-				scene.add( ambientLight );
-
 				// probe
 				// probe
 				lightProbe = new THREE.LightProbe( 0xffffff, API.lightProbeIntensity );
 				lightProbe = new THREE.LightProbe( 0xffffff, API.lightProbeIntensity );
 				scene.add( lightProbe );
 				scene.add( lightProbe );
@@ -137,7 +131,7 @@
 					//var geometry = new THREE.TorusKnotBufferGeometry( 4, 1.5, 256, 32, 2, 3 );
 					//var geometry = new THREE.TorusKnotBufferGeometry( 4, 1.5, 256, 32, 2, 3 );
 
 
 					var material = new THREE.MeshStandardMaterial( {
 					var material = new THREE.MeshStandardMaterial( {
-						color: 0xffffff, 
+						color: 0xffffff,
 						metalness: 0,
 						metalness: 0,
 						roughness: 0,
 						roughness: 0,
 						envMap: cubeTexture,
 						envMap: cubeTexture,
@@ -161,9 +155,6 @@
 				gui.domElement.style.userSelect = 'none';
 				gui.domElement.style.userSelect = 'none';
 
 
 				var fl = gui.addFolder( 'Intensity' );
 				var fl = gui.addFolder( 'Intensity' );
-				fl.add( API, 'ambientLightIntensity', 0, 1, 0.02 )
-					.name( 'ambient light')
-					.onChange( function() { ambientLight.intensity = API.ambientLightIntensity; render(); } );
 
 
 				fl.add( API, 'lightProbeIntensity', 0, 1, 0.02 )
 				fl.add( API, 'lightProbeIntensity', 0, 1, 0.02 )
 					.name( 'light probe')
 					.name( 'light probe')