build

suspend fun <T : Renderable, B : Renderable.Builder<T, B>> Renderable.Builder<T, B>.build(engine: Engine, coroutineScope: LifecycleCoroutineScope)

Load a Renderable in a coroutine scope without blocking a thread.

This suspending function is cancellable. If the Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function stops waiting for the completion stage and immediately resumes with CancellationException. This method is intended to be used with one-shot futures, so on coroutine cancellation the CompletableFuture that corresponds to this CompletionStage (see CompletionStage.toCompletableFuture) is cancelled. If cancelling the given stage is undesired, stage.asDeferred().await() should be used instead.

Return

the created directional light

See also

KTXLoader.loadEnvironment
HDRLoader.loadEnvironment