-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Describe the bug
The resulting environment map from PMREMGenerator.fromScene differs when calling renderer.setClearColor( 0xffffff ) beforehand vs calling scene.background = new Color( 0xffffff );.
To Reproduce
You can see the difference in behavior in this fiddle:
https://jsfiddle.net/0saxwg6n/
Uncomment this line to see the behavior difference:
// NOTE: Uncomment this line to make it work
// scene.background = new THREE.Color( 0xffffff );
Code
Setting clear color:
renderer.setClearColor( 0xffffff );
const generator = new THREE.PMREMGenerator( renderer );
const rt = generator.fromScene( scene );
scene.environment = rt.texture;Setting scene background:
scene.background = new THREE.Color( 0xffffff );
const generator = new THREE.PMREMGenerator( renderer );
const rt = generator.fromScene( scene );
scene.environment = rt.texture;Expected behavior
The look of the resulting map is the same regardless of whether or not the background color is set via scene.background or renderer clear color.
Screenshots
renderer.setClearColor( 0xffffff );
scene.background = new Color( 0xffffff );
(an aside but is it expected that the background become so much darker when rendering to the environment map?)
Platform:
- Device: Desktop
- OS: Windows 10
- Browser: Chrome
- Three.js version: dev

