filament icon indicating copy to clipboard operation
filament copied to clipboard

Support for more glTF material extensions.

Open Nemi26 opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe.

Hello, I don't know if Filament is still under active development w.r.t. adding new features or primarily maintenance, but a couple of new glTF extensions dropped recently:

https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_dispersion https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_diffuse_transmission

These three seem reasonably easy to add (given that they include sample code) and would make Filament a more compliant glTF renderer.

Describe the solution you'd like support for three new glTF material extensions.

Describe alternatives you've considered None

OS and backend not backend specific

Nemi26 avatar Dec 09 '24 23:12 Nemi26

Filament is under active development and while we would like to add support for those extensions, it's difficult to prioritize them as no one has been asking for them. We do have a working version of _dispersion and _diffuse_transmission somehwere though.

romainguy avatar Dec 11 '24 19:12 romainguy

Filament is under active development and while we would like to add support for those extensions, it's difficult to prioritize them as no one has been asking for them. We do have a working version of _dispersion and _diffuse_transmission somehwere though.

We're also running out of samplers, so some features can't be implemented or would only be supported on FEATURE_LEVEL_3. It's not been a priority.

pixelflinger avatar Dec 13 '24 00:12 pixelflinger

Could you please provide the available version code branches? We urgently need _dispersion and _diffuse_transmission.

@romainguy

NeilHe996 avatar Apr 27 '25 06:04 NeilHe996

@romainguy say is there a way to get this version by any chance? i mean the one with the dispersion

DmitriyZagorski-web avatar Nov 26 '25 16:11 DmitriyZagorski-web

@DmitriyZagorski-web @NeilHe996 I ended up implementing dispersion myself, it's quite a simple extension.

if dispersion is present, turn etaRI and etaRI into a vec3, use the formula on the gltf spec page to get the 3 ior values, and then when evaluating the refractions, compute 3 rays instead of 1, and add the results per channel to Ft.

I could make a PR maybe

Nemi26 avatar Dec 02 '25 01:12 Nemi26

@Nemi26 Appreciate the quick response!! really glad to hear that its pretty simple to implement. If its possible to share the PR i would be more then happy to put my hand on the code 💃 .

thank you!!!! 🥇

DmitriyZagorski-web avatar Dec 02 '25 17:12 DmitriyZagorski-web