IrradianceFilter

Generates an irradiance cubemap. An instance is needed per filter configuration.

Constructors

Link copied to clipboard
constructor(context: IBLPrefilterContext, config: IBLPrefilterContext.IrradianceFilter.Config = Config())

Types

Link copied to clipboard
class Config(var sampleCount: Int = 1024, var kernel: IBLPrefilterContext.Kernel = Kernel.D_GGX)

Filter configuration.

Link copied to clipboard
class Options(var hdrLinear: Float = 1024.0f, var hdrMax: Float = 16384.0f, var lodOffset: Float = 2.0f, var generateMipmap: Boolean = true)

Filtering options for the current environment.

Functions

Link copied to clipboard
open override fun close()

Same as destroy; lets this be used with use { } and try-with-resources.

Link copied to clipboard
fun destroy()

Destroys all GPU resources created during initialization.

Link copied to clipboard
operator fun invoke(environmentCubemap: Texture, outIrradianceTexture: Texture? = null): Texture

invoke with the default Options.

operator fun invoke(options: IBLPrefilterContext.IrradianceFilter.Options, environmentCubemap: Texture, outIrradianceTexture: Texture? = null): Texture

Generates an irradiance cubemap. Mipmaps are used in the generation, so the environment cubemap must be SAMPLEABLE with all its levels allocated. If Options.generateMipmap is true, the mipmap levels are overwritten.