I’m using this .hdr file as an environment map for my scene by creating an HDRCubeTexture
from it. This works at least on some systems as demonstrated by this playground:
However, because it doesn’t work everywhere (it causes a crash because of loss of WebGL context in Firefox on Android), and because of the general recommendation to prefer .env, I’ve been trying to convert this .hdr file to .env using the IBL texture tool.
This fails, and in the developer console I get an error message:
Uncaught HDR Bad header format, not RLE
How can I successfully create the .env? my .hdr is created from this ambientcg asset, so if someone has an alternative route to turn that into an environment map which reliably works in Babylon.js, that also works for me.
Hello
I often meet this issue, coming from, like said, the fact that BabylonJS tool needs RLE compression.
On Linux I fix the hdr like so with magick
:
convert DaySkyHDRI041B.hdr -compress RLE DaySkyHDRI041B_FIXED.hdr
Fixed .hdr and .env output :
DaySkyHDRI041B.zip (925.9 KB)
@Deltakosh maybe we could include in the tool an RLE convert ?
2 Likes
Thank you for the rapid response, I can confirm that the resulting .env does indeed work with Babylon.js.
The convert command does seem to affect the visual appearance, though: The scene appears dimmer when using the “fixed” hdr (or the resulting env) as an environment map compared to the original hdr file. Do you know why that is and if this effect can be avoided?
I am working on a tool update, you can currently generate the env from the sandbox
DaySkyHDRI041B.zip (288.8 KB)
2 Likes