google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.75k stars 1.88k forks source link

Support KTX2 texture #4771

Closed 0k1019 closed 2 years ago

0k1019 commented 2 years ago

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

Filament can't render GLB/GLTB file containing KTX2 texture. The explanation of KTX2 is in Khronos group website. Examples GLB files containing KTX2.

Describe the solution you'd like I wish filament supports to render KTX2 texture. KTX2 is really nice for rendering quality and compression 3D file.

Describe alternatives you've considered cgltf.h: This line means GLB with ktx2 texture convert to basisu_image not image.

AssetLoader.cpp: This line means basisu_image can't load to render.

Accept basisu_image in AssetLoader.

Testing in filament viewer between GLB(with png) and GLB(with KTX2) image

OS and backend macOS Big Sur 11.6 Chrome 95.0.4638.54 (x86_64)

Thank you for @codpot's help.

August1996 commented 2 years ago

May I ask which version of the features of ktx2 is planned to support?😊

prideout commented 2 years ago

We intend to fully support KHR_texture_basisu and use that as the driving force for our ktx2 support. The only reason we would drop features would be to reduce binary size.

August1996 commented 2 years ago

We intend to fully support KHR_texture_basisu and use that as the driving force for our ktx2 support. The only reason we would drop features would be to reduce binary size.

very good feature👍. have you started developing this feature?

simonsland commented 2 years ago

We intend to fully support KHR_texture_basisu and use that as the driving force for our ktx2 support. The only reason we would drop features would be to reduce binary size.

Looking forward to the support of ktx2. Recently, we are also try to using ktx2 texture in our project through filament.

zhazhaxia commented 2 years ago

Looking forward to the support of ktx2. +1s

prideout commented 2 years ago

This was fixed a few weeks ago, forgot to close the ticket.

0k1019 commented 2 years ago

@prideout Thank you for support KTX2

But I found that it is not working in filament 1.22.0

Not working in gltf_viewer

image image

Not working in filament web viewer

스크린샷 2022-05-16 오후 5 02 41

macOS Monterey 12.3.1(21E258) Chrome 101.0.4951.64 (x86_64)

prideout commented 2 years ago

Correct, it is supported on main only. The final commit for this feature landed on May 2 with https://github.com/google/filament/commit/f035655f5b2a2d288d5df73709642dd219450e23, so it should arrive with v1.22.1

0k1019 commented 2 years ago

Thank you for supporting this feature. It works in filament viewer.

스크린샷 2022-05-18 오후 2 49 05

Web viewer is not working because it is v1.22.0 filament.js. I think it working soon.