浏览代码

add a ground plane to make it obvious there is a spot light on the object.

Ben Houston 9 年之前
父节点
当前提交
a21fd992ac
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17 0
      examples/webgl_materials_envmaps_hdr.html

+ 17 - 0
examples/webgl_materials_envmaps_hdr.html

@@ -124,6 +124,22 @@
 				  torusMesh1.position.x = 0.0;
 				  scene.add( torusMesh1 );
 					objects.push( torusMesh1 );
+
+					var floorMaterial = new THREE.MeshStandardMaterial( {
+						map: null,
+						roughnessMap: null,
+						color: 0xffffff,
+						metalness: 0.0,
+						roughness: 0.0,
+						envMap: pmremCubeUVPacker.CubeUVRenderTarget,
+						shading: THREE.SmoothShading
+					});
+
+					var planeGeometry = new THREE.PlaneBufferGeometry( 200, 200 );
+				  var planeMesh1 = new THREE.Mesh( planeGeometry, floorMaterial );
+					planeMesh1.position.y = -50;
+					planeMesh1.rotation.x = -Math.PI * 0.5;
+					scene.add( planeMesh1 );
 				} );
 
 				// Lights
@@ -133,6 +149,7 @@
 				var spotLight = new THREE.SpotLight( 0xffffff );
 				spotLight.position.set( 10, 100, 10 );
 				spotLight.angle = Math.PI/10;
+				spotLight.penumbra = 0.2
 				scene.add( spotLight );
 
 				renderer = new THREE.WebGLRenderer( { alpha:true, antialias: false } );