Преглед изворни кода

RoomEnvironment: Set emissiveIntensity instead (#31348)

* Set emissiveIntensity instead

* Update inline comments
WestLangley пре 11 месеци
родитељ
комит
8e7e3dfb31
2 измењених фајлова са 9 додато и 4 уклоњено
  1. 8 3
      examples/jsm/environments/RoomEnvironment.js
  2. 1 1
      src/materials/MeshBasicMaterial.js

+ 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号