PMREMGenerator.fromScene() alters background color
See original GitHub issueIn PMREMGenerator.fromScene( scene )
, scene.background
is changed and not restored.
In webgl_materials_car.html
, do this:
scene = new THREE.Scene();
scene.background = new THREE.Color( 0x0000ff );
scene.environment = pmremGenerator.fromScene( scene ).texture;
console.log( scene.background ); // null
Also,
renderer.setClearColor( 0x0000ff, 1 );
has different behavior. I would have expected them to be equivalent.
three.js r131
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Another 10 More Three.JS Tips and a bonus - Nik Lever
You use a PMREMGenerator which has a fromScene method. const envmap = pmremGenerator.fromScene( new RoomEnvironment(), 0.04 ).texture;. HTML; CSS; JS.
Read more >ThreeJS Selective Bloom Disable Bloom For Scene Background
In the render loop, use scene.background instead of renderer.setClearColor . Define scene backgrounds let scback = { bloomOn: new THREE.
Read more >PMREMGenerator – three.js docs
PMREMGenerator. This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture.
Read more >Three.js Generate Environment - JSFiddle - Code Playground
Scene(). 7. //scene.background = new THREE.Color('black') ... const pmremGenerator = new THREE.PMREMGenerator(renderer) ... fromScene(scene, 0.01).texture.
Read more >Creating a game in Three.js - LogRocket Blog
export const scene = new Scene() export const camera = new ... one of the main ones is that our game will pause...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That sounds like a good start!
@WestLangley said
I suggest that
PMREMGenerator
checkrenderer.outputEncoding
to determine what colorspace the clear color is in – and not assume it is insRGB
. (For simplicity, maybe consider only linear and sRGB, although that would not be completely correct.)