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.35k stars 1.84k forks source link

[Looking for info] Confused about cmgen usage/outputs #7844

Closed Froyok closed 1 month ago

Froyok commented 1 month ago

Hi ! I'm looking at cmgen provided with Filament, but I'm a bit confused about it usage. (To clarify the intended use is not for Filament but for another software.)

I was hoping to be able to use cmgen to pre-filter my cubemaps for IBL lighting (radiance notably). So far I can only output the mip level as individual files using the extract command, I cannot find a way to get a single dds file with all the mips together.

Using: cmgen -f dds -x ./out cubemap.exr

Is there a way to output a single dds file in cube format that contains all the mip levels ? Or are we supposed to build that final cubemap file ourselves via another tool ? If so which one ?

The documentation inside BUILDING.md via the section Running the native samples doesn't explain followup steps. Also I saw that the example uses the ktx format, which produce files I cannot inspect (or I don't know tools that allow it). Ideally I would prefer to use DDS in my other software.

Thanks in advance. :)

romainguy commented 1 month ago

cmgen doesn't output DDS files, only individual files or combined as KTX. KTX is an open format supported by Khronos: https://www.khronos.org/ktx/

Froyok commented 1 month ago

Do you know by any chance a tool that allow to go from KTX to DDS ? I have tried to find one for a while without any luck.

romainguy commented 1 month ago

No idea, we live in a world of GL/Vulkan/Metal, so DDS is not really something we ever worried about/looked into. KTX is easy to handle btw (esp. KTX1, it's essentially a direct memory mapping from GL constants to bytes on disk).

Froyok commented 1 month ago

Yeah, after looking around it seems I will have to write something on my own. Thx for the inputs ! :)