ImageBasedLightingAsset


class ImageBasedLightingAsset : AutoCloseable


Represents an image based lighting asset which contains lighting information for the scene.

EXR and HDR images are supported by the SpatialEnvironment.

Summary

Public companion functions

suspend ImageBasedLightingAsset
@MainThread
createFromZip(session: Session, path: Path)

Public factory for an ImageBasedLightingAsset, asynchronously loading a preprocessed image based lighting asset from a Path relative to the application's assets/ folder.

suspend ImageBasedLightingAsset
@MainThread
createFromZip(session: Session, uri: Uri)

Public factory for an ImageBasedLightingAsset, asynchronously loading a preprocessed image based lighting asset from a Uri.

Public functions

open Unit

Closes the given ImageBasedLightingAsset.

open operator Boolean
equals(other: Any?)
open Int

Public companion functions

createFromZip

@MainThread
suspend fun createFromZip(session: Session, path: Path): ImageBasedLightingAsset

Public factory for an ImageBasedLightingAsset, asynchronously loading a preprocessed image based lighting asset from a Path relative to the application's assets/ folder.

The input .zip file should contain the preprocessed image-based lighting (IBL) data, typically generated from an .exr or .hdr environment map using a tool like Filament's cmgen. See: https://github.com/google/filament/tree/main/tools/cmgen

Parameters
session: Session

The Session to use for loading the asset.

path: Path

The Path of the preprocessed .zip image based lighting asset file to be loaded, relative to the application's assets/ folder.

Throws
IllegalArgumentException

if Path.isAbsolute is true, as this method requires a relative path, or if the path does not specify a .zip file.

createFromZip

@MainThread
suspend fun createFromZip(session: Session, uri: Uri): ImageBasedLightingAsset

Public factory for an ImageBasedLightingAsset, asynchronously loading a preprocessed image based lighting asset from a Uri.

The input .zip file should contain the preprocessed image-based lighting (IBL) data, typically generated from an .exr or .hdr environment map using a tool like Filament's cmgen. See: https://github.com/google/filament/tree/main/tools/cmgen

Parameters
session: Session

The Session to use for loading the asset.

uri: Uri

The Uri of the preprocessed .zip image based lighting asset file to be loaded.

Throws
IllegalArgumentException

if the Uri does not specify a .zip file.

Public functions

close

Added in 1.0.0-alpha16
@MainThread
open fun close(): Unit

Closes the given ImageBasedLightingAsset.

The ImageBasedLightingAsset can be explicitly closed at any time or garbage collected. When either happens, its resources are freed. If close() is not explicitly invoked by the client, the ImageBasedLightingAsset will be automatically closed when the ImageBasedLightingAsset is garbage collected.

Throws
IllegalStateException

if the resource has already been closed.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int