Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for R11F_G11F_B10F, and/or fix IBL instructions in Sandcastle #9088

Open
emackey opened this issue Aug 10, 2020 · 3 comments
Open

Comments

@emackey
Copy link
Contributor

emackey commented Aug 10, 2020

In the Image-Based Lighting Sandcastle Demo, there are comments recommending how to create a .ktx file for use as an HDRI lighting environment. The instructions recommend downloading Google Filament and using their cmgen tool (from the bin folder).

So I tried that with Filament 1.8.1 on a free HDRI called Symmetrical Garden (from HDRI Haven), and the result is this KTX file:

symmetrical_garden_1k_ibl.zip

The KTX file came out of Filament with a pixel format of R11F_G11F_B10F (35898), which is not supported in Cesium.

Can support for this pixel format be added? (I tried naively adding the format to the supported list, but clearly it takes a little more than that to get it working).

@emackey
Copy link
Contributor Author

emackey commented Aug 10, 2020

Worth noting that the old cmgen, at the time this demo was first published, had this note in the command-line help message:

   KTX files are always encoded with 4-channel RGBM data

But the latest cmgen has this note instead:

   KTX files are always encoded with 3-channel RGB_10_11_11_REV data

@lilleyse
Copy link
Contributor

@YoussefV you ran into something similar right? I know there were a few open threads about Filament, the KTX1->KTX2 converter, and CesiumJS. Where did we settle on those?

CC #9040

@YVin3D
Copy link
Contributor

YVin3D commented Aug 11, 2020

Yep, so for R11F_G11F_B10F pixel formats, you can use the WebGLConstants.R11F_G11F_B10F as the internal format of the image in your compressedTextureBuffer. The IBL sandcastle instructions didn't work for me either when i tried converting the kiara environment map to .ktx2, so I had to basically rewrite the original .ktx binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants