Back to Filament

setIntensity

docs/android/dokka/filament-android/com.google.android.filament/-light-manager/set-intensity.md

1.75.02.0 KB
Original Source

//filament-android/com.google.android.filament/LightManager/setIntensity

setIntensity

[main]
open fun setIntensity(i: Int, intensity: Float)

Dynamically updates the light's intensity. The intensity can be negative.

Parameters

main

iInstance of the component obtained from getInstance().
intensityThis parameter depends on the Type, for directional lights, it specifies the illuminance in lux (or lumen/m^2). For point lights and spot lights, it specifies the luminous power in lumen. For example, the sun's illuminance is about 100,000 lux.

See also

com.google.android.filament.LightManager.Builder

[main]
open fun setIntensity(i: Int, watts: Float, efficiency: Float)

Dynamically updates the light's intensity. The intensity can be negative.

kotlin
 Lightbulb type  | Efficiency
-----------------+------------
    Incandescent |  2.2%
        Halogen  |  7.0%
            LED  |  8.7%
    Fluorescent  | 10.7%

This call is equivalent to: ```kotlin Builder.intensity(efficiency * 683 * watts);


#### Parameters

main

| | |
|---|---|
| i | Instance of the component obtained from getInstance(). |
| watts | Energy consumed by a lightbulb. It is related to the energy produced and ultimately the brightness by the efficiency parameter. This value is often available on the packaging of commercial lightbulbs. |
| efficiency | Efficiency in percent. This depends on the type of lightbulb used. |