Back to Filament

compile

docs/android/dokka/filament-android/com.google.android.filament/-engine/compile.md

1.75.01.8 KB
Original Source

//filament-android/com.google.android.filament/Engine/compile

compile

[main]
open fun compile(priority: Material.CompilerPriorityQueue, material: Material, view: View, shadowReceiver: Engine.FeatureState, skinning: Engine.FeatureState, handler: Any, callback: Runnable)

Asynchronously ensures that the variants of the specified Material required to render it in the provided View are compiled. This determines the necessary permutations of feature flags based on the supplied View, and compiles the corresponding shader variants. See compile for important details about the compilation process, callback scheduling, priorities, and flushing the engine.

Parameters

main

priorityWhich priority queue to use, LOW or HIGH.
materialThe Material whose variants will be compiled.
viewThe View in which the material will be rendered.
shadowReceiverIndicates whether to compile variants where the material receives shadows. Use FeatureState.INDETERMINATE to compile both permutations.
skinningIndicates whether to compile variants with skinning. Use FeatureState.INDETERMINATE to compile both permutations.
handlerAn Executor. On Android this can also be a Handler.
callbackcallback called on the main thread when the compilation is done by backend.