question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scene.environment set to anything other than PMREMGenerator output is unuseable - bug or feature?

See original GitHub issue

for example,

var envMap = new THREE.Texture( whatever );
envMap.mapping = THREE.EquirectangularReflectionMapping;
envMap.needsUpdate = true;
scene.environment = envMap;

will creaate ridiculously dark scene, while running same texture through PMREMGenerator performs as expected.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Mar 9, 2020

It’s already noted in the docs that you can only use an env map in cube map format with MeshStandardMaterial:

Note: only cube environment maps are supported for MeshStandardMaterial. If you want to use an equirectangular map you will need to use WebGLCubeRenderTarget.fromEquirectangularTexture().

So this code should produce a response:

var cubeRenderTarget = new WebGLCubeRenderTarget( 1024 ).fromEquirectangularTexture( renderer, envMap );
scene.environment = cubeRenderTarget.texture;

Also set metalness to 1 and roughness to 0 to better see the env map.

https://jsfiddle.net/nt4pL0dg/

0reactions
makccommented, Mar 9, 2020

So, feature then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Envmap + no lights = dark scene - Questions - three.js forum
scene.environment set to anything other than PMREMGenerator output is unuseable - bug or feature? ... for example, var envMap = new THREE.Texture( ...
Read more >
RGBELoader low quality of texture - 256 x 256 - Stack Overflow
The problem in your code is that the result of PMREMGenerator should not be used for Scene.background . Besides, the renderer automatically ...
Read more >
Creating a game in Three.js - LogRocket Blog
Develop games using Three.js, a 3D library that provides an easy way to load models, and allows users to play the game within...
Read more >
https://raw.githubusercontent.com/BabylonJS/Babylo...
As in the majority of the scene they are the same (exception for multi room and so on), * this is easier to...
Read more >
10 Three.JS Tips - Nik Lever
Then we tidy up memory and set the scene.environment. No 4. Renderer.outputEncoding. If you use the GLTFLoader class then make sure to set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found