loadKTX1Environment

suspend fun loadKTX1Environment(iblUrl: String? = null, skyboxUrl: String? = null): Environment

Utility for producing environment resources from precompiled cmgen generated KTX files.

Consumes the content of KTX files and produces an IndirectLight, SphericalHarmonics and a Skybox

You can generate ktx ibl and skybox files using:

cmgen --deploy ./output --format=ktx --size=256 --extract-blur=0.1 environment.hdr

Documentation: Filament - Bake environment map

Return

the generated environment indirect light, sphericalHarmonics and skybox from the ktxs.

Parameters

iblUrl

The ibl KTX file url.

skyboxUrl

The skybox KTX file url.


suspend fun loadKTX1Environment(url: String, indirectLightSpecularFilter: Boolean = true, textureOptions: HDRLoader.Options = HDRLoader.Options(), createSkybox: Boolean = true): Environment?

Utility for decoding and producing environment resources from an HDR file.

Consumes the content of an HDR file and produces an IndirectLight and a Skybox.

Return

the generated environment indirect light and skybox from the hdr.

Parameters

url

The HDR File url.

indirectLightSpecularFilter

Generates a prefiltered indirect light cubemap. SpecularFilter is a GPU based implementation of the specular probe pre-integration filter. ** Launch the heaver computation. Expect 100-100ms on the GPU.**

textureOptions

texture loader options

createSkybox

Disable the skybox creation if you don't need it.

See also

HDRLoader.createTexture