SpecularFilter

Generates a prefiltered (specular) cubemap. An instance is needed per filter configuration.

Constructors

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

Types

Link copied to clipboard
class Config(var sampleCount: Int = 1024, var levelCount: Int = 5, 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 = 1.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, outReflectionsTexture: Texture? = null): Texture

invoke with the default Options: all mipmap levels are overwritten.

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

Generates a prefiltered cubemap. The environment cubemap must be SAMPLEABLE with all its levels allocated. If Options.generateMipmap is true, the mipmap levels are overwritten.