filament icon indicating copy to clipboard operation
filament copied to clipboard

Implement KHR_materials_dispersion

Open Nemi26 opened this issue 1 month ago • 6 comments

Hi, this commit implements the gltf dispersion extension. Partially fixes https://github.com/google/filament/issues/8307

Dragon Dispersion demonstration: image

Nemi26 avatar Dec 02 '25 20:12 Nemi26

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Dec 02 '25 20:12 google-cla[bot]

@Nemi26 also you need to add to the release notes

pixelflinger avatar Dec 03 '25 19:12 pixelflinger

oh, and also I think you need to add a unit test for that property.

pixelflinger avatar Dec 03 '25 19:12 pixelflinger

@Nemi26 see my comments above.

pixelflinger avatar Dec 09 '25 05:12 pixelflinger

@pixelflinger I added the things you mentioned, as well as some tiny fixes (checking that refraction type is solid in order for dispersion to be enabled). I wasn't able to pull out that refraction inner loop code into a separate function in a way that would make it more readable unfortunately.

Nemi26 avatar Dec 09 '25 12:12 Nemi26

oops, looks like all builds are broken.

pixelflinger avatar Dec 09 '25 18:12 pixelflinger

@Nemi26 the dispersion doesn't work with gltf_viewer's -u (ubershader) option; it crashes. FYI. Do you want to give it a shot at fixing it, or should I revert the change for now?

Also, I do see the effect working with khronos' DragonDispersion test, but not with the DispersionTest.

pixelflinger avatar Dec 19 '25 22:12 pixelflinger