EnvironmentLoader

class EnvironmentLoader(val engine: Engine, context: Context, coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.IO))

Utility for decoding an HDR file or consuming KTX1 files and producing Filament textures, IBLs, and sky boxes.

KTX is a simple container format that makes it easy to bundle miplevels and cubemap faces into a single file.

Consuming the content of an HDR file and produces a Texture object to enerates a prefiltered indirect light cubemap with specular filter is a GPU based implementation of the specular probe pre-integration filter. ** Launch the heaver computation. Expect 100-100ms on the GPU.**

Constructors

Link copied to clipboard
constructor(engine: Engine, context: Context, coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.IO))

Properties

Link copied to clipboard
val engine: Engine
Link copied to clipboard

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard
fun createEnvironment(indirectLight: IndirectLight? = null, skybox: Skybox? = null, sphericalHarmonics: FloatArray? = null): Environment
Link copied to clipboard
fun createHDREnvironment(file: File, indirectLightSpecularFilter: Boolean = true, textureOptions: HDRLoader.Options = HDRLoader.Options(), createSkybox: Boolean = true): Environment?
fun createHDREnvironment(@RawRes rawResId: Int, indirectLightSpecularFilter: Boolean = true, textureOptions: HDRLoader.Options = HDRLoader.Options(), createSkybox: Boolean = true): Environment?
fun createHDREnvironment(assetFileLocation: String, indirectLightSpecularFilter: Boolean = true, textureOptions: HDRLoader.Options = HDRLoader.Options(), createSkybox: Boolean = true): Environment?
fun createHDREnvironment(buffer: Buffer, indirectLightSpecularFilter: Boolean = true, indirectLightApply: IndirectLight.Builder.() -> Unit = {}, textureOptions: HDRLoader.Options = HDRLoader.Options(), createSkybox: Boolean = true): Environment?

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

Link copied to clipboard
fun createKTX1Environment(iblFile: File? = null, skyboxFile: File? = null): Environment
fun createKTX1Environment(iblBuffer: Buffer? = null, skyboxBuffer: Buffer? = null): Environment
fun createKTX1Environment(iblRawResId: Int? = null, skyboxRawResId: Int? = null): Environment
fun createKTX1Environment(iblAssetFile: String? = null, skyboxAssetFile: String? = null): Environment

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

Link copied to clipboard
fun destroy()
Link copied to clipboard
Link copied to clipboard
suspend fun loadHDREnvironment(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.

Link copied to clipboard
suspend fun loadKTX1Environment(iblUrl: String? = null, skyboxUrl: String? = null): Environment

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

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.