Просмотр исходного кода

RoomEnvironment: Set emissiveIntensity instead (#31348)

* Set emissiveIntensity instead

* Update inline comments
WestLangley 9 месяцев назад
Родитель
Сommit
8e7e3dfb31

+ 8 - 3
examples/jsm/environments/RoomEnvironment.js

@@ -3,7 +3,7 @@ import {
  	BoxGeometry,
  	InstancedMesh,
  	Mesh,
-	MeshBasicMaterial,
+	MeshLambertMaterial,
  	MeshStandardMaterial,
  	PointLight,
  	Scene,
@@ -168,8 +168,13 @@ class RoomEnvironment extends Scene {
 
 function createAreaLightMaterial( intensity ) {
 
-	const material = new MeshBasicMaterial();
-	material.color.setScalar( intensity );
+	// create an emissive-only material. see #31348
+	const material = new MeshLambertMaterial( {
+		color: 0x000000,
+		emissive: 0xffffff,
+		emissiveIntensity: intensity
+	} );
+
 	return material;
 
 }

+ 1 - 1
src/materials/MeshBasicMaterial.js

@@ -42,7 +42,7 @@ class MeshBasicMaterial extends Material {
 		 * @type {Color}
 		 * @default (1,1,1)
 		 */
-		this.color = new Color( 0xffffff ); // emissive
+		this.color = new Color( 0xffffff ); // diffuse
 
 		/**
 		 * The color map. May optionally include an alpha channel, typically combined

粤ICP备19079148号