瀏覽代碼

Improved examples.

Mr.doob 9 年之前
父節點
當前提交
aee12bbd65
共有 2 個文件被更改,包括 11 次插入16 次删除
  1. 9 14
      examples/webgl_lights_physical.html
  2. 2 2
      examples/webgl_tonemapping.html

+ 9 - 14
examples/webgl_lights_physical.html

@@ -86,7 +86,7 @@
 			var params = {
 				shadows: true,
 				exposure: 0.68,
-				bulbPower: Object.keys( bulbLuminousPowers )[2],
+				bulbPower: Object.keys( bulbLuminousPowers )[ 4 ],
 				hemiIrradiance: Object.keys( hemiLuminousIrradiances )[0]
 			};
 
@@ -107,7 +107,7 @@
 				camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 100 );
 				camera.position.x = -4;
 				camera.position.z = 4;
-				camera.position.y = 3;
+				camera.position.y = 2;
 
 				scene = new THREE.Scene();
 
@@ -183,24 +183,18 @@
 				} );
 
 				ballMat = new THREE.MeshStandardMaterial( {
-					roughness: 0,
-					metalness: 0.0,
-					color: 0xffffff
+					color: 0xffffff,
+					roughness: 0.5,
+					metalness: 1.0
 				});
 				textureLoader.load( "../examples/textures/planets/earth_atmos_2048.jpg", function( map ) {
-					map.wrapS = THREE.RepeatWrapping;
-					map.wrapT = THREE.RepeatWrapping;
 					map.anisotropy = 4;
-					map.repeat.set( 1, 1 );
 					ballMat.map = map;
 					ballMat.needsUpdate = true;
 				} );
 				textureLoader.load( "../examples/textures/planets/earth_specular_2048.jpg", function( map ) {
-					map.wrapS = THREE.RepeatWrapping;
-					map.wrapT = THREE.RepeatWrapping;
 					map.anisotropy = 4;
-					map.repeat.set( 1, 1 );
-					ballMat.roughnessMap = map;
+					ballMat.metalnessMap = map;
 					ballMat.needsUpdate = true;
 				} );
 
@@ -210,9 +204,10 @@
 				floorMesh.rotation.x = -Math.PI / 2.0;
 				scene.add( floorMesh );
 
-				var ballGeometry = new THREE.SphereGeometry( 0.1213, 32, 32 );
+				var ballGeometry = new THREE.SphereGeometry( 0.5, 32, 32 );
 				var ballMesh = new THREE.Mesh( ballGeometry, ballMat );
-				ballMesh.position.set( 1, 0.1213, 1 );
+				ballMesh.position.set( 1, 0.5, 1 );
+				ballMesh.rotation.y = Math.PI;
 				ballMesh.castShadow = true;
 				scene.add( ballMesh );
 

+ 2 - 2
examples/webgl_tonemapping.html

@@ -6,7 +6,7 @@
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
 			body {
-				color: #000;
+				color: #fff;
 				font-family:Monospace;
 				font-size:13px;
 				text-align:center;
@@ -17,7 +17,7 @@
 				overflow: hidden;
 			}
 
-			a { color: #222 }
+			a { color: #ff2 }
 
 			#info {
 				position: absolute;