ES6 Import of babylonjs/core ignoring side effects required for KHR_materials_transmission

Hey folks,
First of all thank you so much for maintaining Babylon.js, really grateful for that ! We at Flipkart use it extensively for powering one of the largest 3D Ecommerce use case in India (or probably the world) !
We recently came across this bug where were trying to add support for KHR_Materials_Transmission and we’ve been getting shader errors and unable to figure out what side effect should we be importing to fix it.
We broadly understand that it’s because of our usage of specific imports rather than importing full side effect import for bundle size requirements.
We want to drill down as to which side effects are required to make it work, if yes, can we add this to the documentation somewhere

Repro link with our SDK: FK Camera 3D SDK Lite

Note: This is not reproducible on Sandbox / Playground because of the style of imports these deployments have.

cc @sebavan @RaananW

Will be very hard to tell you exactly what’s missing, but from looking at the error console, it seems like you are missing the definition of radiance, which is a part of the HDR Filtering module. Try importing the HDR Cube texture and see if it solves the issue. You can also try being more granular and import the HDRFiltering class, but as it is only used in the HDR cube texture, it might be that it is needed as well.

1 Like

Tried importing it, didn’t work, could it because of realTimeFiltering ?

My first sentence in my last message is still valid :slight_smile: . Without sharing code it is very hard to tell.

The shader complains about the lack of correct definition of radiance. I couldn’t find this function defined anywhere else other than the HDR filtering class, but maybe @sebavan has a different idea.

Actually, it’s a bug related to using realtime filtering with the KHR_Materials_Transmission extension and is not related to ES6. Going to have a look.

1 Like

The bug will be fixed by:


Approved, thanks a lot for the quick fix :slight_smile: