EXR file format

Hey team! Just before leaving for a week and half (WoW The War Within is calling!), I wanted to share that I have pushed an update with that PR that will add support for exr file format:
EXR file format support by deltakosh · Pull Request #15461 · BabylonJS/Babylon.js (github.com)

Using it is really trivial:

var mat = new BABYLON.StandardMaterial("mat", scene);
mat.emissiveTexture = new BABYLON.Texture("https://assets.babylonjs.com/textures/green-door.exr", scene);

By default the system generates 16bits floats but you can ask for 32 bits with this code:

BABYLON.ExrLoaderGlobalConfiguration.DefaultOutputType = BABYLON.EXROutputType.Float;

I know at least one person (@PatrickRyan ) who will be super happy with that :wink:

Enjoy!

10 Likes

Thanks @Deltakosh!

Enjoy your well earned time off!

1 Like

Yo @Deltakosh … WOW this could be huge for native HDR via EXR files for Unity exported content. Few questions:

1… Does that mean native High Dynamic Range images in exr file format ?

2… So I should be able to use native save as exr file ?

3… And what about lightmaps, native exr should be better than RGBD packed PNG for things like lightmaps, Right ?

1 Like
  1. yes it is full 32 bits float my man!
  2. if the exr is using one of our supported compression I see no problem
  3. Probably (maybe not on the size front as exr tents to be huge)
1 Like

What compressions do BJS use ZIP, RLE, WAVELET ?

1 Like

We support: RAW, RLE, ZIP, ZIP-S, PIZ and PRX-24 :wink:

(PIZ is Wavelet)

2 Likes

Nice :slight_smile:

1 Like

Ill try native exr lightmaps, with all the different compression options and see if that is better than what I can do packing RGBD into a 8bit per channel PNG

1 Like

Last Question … So basically I just use lightmapTexture as always, I am just pointing to a EXR file rather than a png or whatever… Or is their a flag or anything to set when you want to ensure EXR encoding ?

And have a great vacation :slight_smile:

Nope this is as simple as that, point your lightmapTexture to an exr file and enjoy (hopefully ;))

Sweet… Thanks again man :slight_smile:

1 Like