Skip to content

Commit 8e7e3df

Browse files
authored
RoomEnvironment: Set emissiveIntensity instead (#31348)
* Set emissiveIntensity instead * Update inline comments
1 parent 3e39fcc commit 8e7e3df

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

examples/jsm/environments/RoomEnvironment.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
BoxGeometry,
44
InstancedMesh,
55
Mesh,
6-
MeshBasicMaterial,
6+
MeshLambertMaterial,
77
MeshStandardMaterial,
88
PointLight,
99
Scene,
@@ -168,8 +168,13 @@ class RoomEnvironment extends Scene {
168168

169169
function createAreaLightMaterial( intensity ) {
170170

171-
const material = new MeshBasicMaterial();
172-
material.color.setScalar( intensity );
171+
// create an emissive-only material. see #31348
172+
const material = new MeshLambertMaterial( {
173+
color: 0x000000,
174+
emissive: 0xffffff,
175+
emissiveIntensity: intensity
176+
} );
177+
173178
return material;
174179

175180
}

src/materials/MeshBasicMaterial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class MeshBasicMaterial extends Material {
4242
* @type {Color}
4343
* @default (1,1,1)
4444
*/
45-
this.color = new Color( 0xffffff ); // emissive
45+
this.color = new Color( 0xffffff ); // diffuse
4646

4747
/**
4848
* The color map. May optionally include an alpha channel, typically combined

0 commit comments

Comments
 (0)