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.

EXR Envmap not working on iOS

See original GitHub issue

Following the example on: https://threejs.org/examples/webgl_materials_envmaps_exr.html and loading a EXR file as environment map with:

var pmremGenerator = new THREE.PMREMGenerator( this.renderer );
pmremGenerator.compileEquirectangularShader();
var exrCubeRenderTarget = pmremGenerator.fromEquirectangular( texture );
this.hdr = exrCubeRenderTarget.texture;

This works perfectly on all desktop browsers but on iOS the HDR is completely black and no lighting is applied to the model. This also applies to the example link on iOS: https://threejs.org/examples/webgl_materials_envmaps_exr.html

Three.js version
  • Dev
  • r115
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
elalishcommented, Apr 8, 2020

@sciecode Yes, that fits with my understanding. That sounds like a reasonable path forward; I don’t have a strong opinion on the shape of three’s API. If we’re planning to overhaul PMREMGenerator it might also be a good time to enable different sizes (right now it’s fixed to outputting a 256x256 cubemap regardless of input size). It seems like with the right choice of defaults we might even be able to make this change non-breaking, which would be nice.

2reactions
sciecodecommented, Apr 7, 2020

I’ve pushed #19070 as a temporary fix for the situation. Even if we decide to pursue other solutions in the future, there’s no harm in allowing EXRLoader to output UnsignedByteType with RGBEFormat.

That way, at least, we have a viable option for people looking to use EXR envmaps with mobile support.

webgl_materials_envmaps_exr.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

EXR example not working on iOS device - three.js forum
Hi, I recently updated my EXR -> EnvMap workflow to follow the latest PMREMGenerator. Everything works well but when testing on an iOS...
Read more >
SceneKit – Loading HDR or EXR lightingEnvironment has no ...
Has anyone experience in using hdr files in SceneKit? XCode Version: 13.2.1 iOS version: 15.3.1 hdr file: https://polyhaven.com/a/ ...
Read more >
EnvironmentResource | Apple Developer Documentation
An environmental resource that contains background and lighting information for a scene. iOS 13.0+ iPadOS 13.0+ macOS 10.15+ Mac Catalyst 13.0+ ...
Read more >
how would I display an EXR environment map as a skybox ...
I've tried to google for this and found no results. I'm familiar with drawing skyboxes as a background for my scenes.
Read more >
Importing and Optimizing EXR Files | Unreal Engine 4.27 ...
Reference guide for optimizing EXR files in UE4. ... either in a Sequencer track or the Media Player window in Editor, can help...
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