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.

PMREMGenerator EnvMaps only work with one renderer

See original GitHub issue
Description of the problem

I don’t know if it is expected or if I miss something, but it looks like the envmap textures generated by PMREGenerator and the renderer specified at that time cannot be re-used with another renderer.

In this example, the envmap is generated using renderer. If the scene is rendered with renderer2, it doesn’t work.

Replace var pmremGenerator = new THREE.PMREMGenerator( renderer ); by var pmremGenerator = new THREE.PMREMGenerator( renderer2 ); on line 49 to check the difference.

Three.js version
  • Dev
  • r115
Browser
  • All of them
OS
  • All of them

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Apr 12, 2020

@sciecode I see this a bit different since the issue I linked was focused about the valid combinations of PMREMGenerator and WebGLRenderer. Hence, I think this discussion belongs to it.

1reaction
sciecodecommented, Apr 12, 2020

By the way, this is not a duplicate of #18976.

This is about sharing a texture between WebGL contexts, which is impossible due to WebGL limitations. The other issue was about using instances of PMREMGenerator with multiple contexts and having the textures replaced because of scoping, which was fixed with your PR.

Issue should still be closed, because there’s nothing we can do about it. But I just wanted to be clear about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PMREMGenerator, CubeCamera and envmap mirroring issues
The only (ugly) workaround so far is mirroring the entire scene along x-axis before the CC.update( renderer, scene ) , while properly ...
Read more >
preprocessing an environment map with PMREMGenerator
So calling compileEquirectangularShader() just distributes some work to the application start. Next, I use TextureLoader to load the envmap ...
Read more >
Three.js Realistic Material Reflection Tutorial - Red Stapler
In this tutorial we're going to show you how to create realistic material reflection in Three.js. This project can be done in just...
Read more >
Three.js Generate Environment - JSFiddle - Code Playground
Create a cubemap with one RGBA pixel on each face ... const envMap = pmremGenerator. ... const controls = new OrbitControls(camera, renderer.domElement).
Read more >
MeshStandardMaterial - Verge3D User Manual - Soft8Soft
Modulates the emissive color. Default is 1. # .envMap : Texture. The environment map. To ensure a physically correct rendering, you should only...
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