Engine API Reference - v2.24.0-beta.10
    Preparing search index...

    Class LensFlare

    A lens flare: a LensFlareLook placed in the world, following a light or a node. Create one for each light that flares, and add it to the LensFlareEffect of a camera frame. The properties of the flare are live - changes apply to the next frame rendered - except the look, whose elements are built into the effect when CameraFrame#update is called.

    const sun = new LensFlare(sunLook, { light: sunEntity.light });
    sun.occlusionRadius = 0.03;
    cameraFrame.getEffect('lensFlare').add(sun);
    cameraFrame.update();
    Index
    allowOffScreen: boolean = true

    Whether the flare keeps drawing while its source is outside the screen, within the edge fade band - the ghosts of a sun just outside the frame. Defaults to true.

    color: Color = ...

    The colour of the flare, tinting its elements. Defaults to white.

    direction: Vec3 | null = null

    The world direction towards the source, or null. See LensFlareOptions.

    edgeFade: number = 0.2

    The width of the band at the edge of the screen the flare fades out over as its source leaves the screen, as a fraction of half the screen size. Defaults to 0.2.

    enabled: boolean = true

    Whether the flare is drawn. Defaults to true.

    fadeEnd: number = 0

    The distance from the camera the flare of a positional source is fully faded out at, in world units. Defaults to 0, which disables the fade.

    fadeStart: number = 0

    The distance from the camera the flare of a positional source starts to fade out at, in world units. The fade is disabled while LensFlare#fadeEnd is not greater than this. Defaults to 0.

    intensity: number = 1

    The brightness of the flare, multiplying the intensity of its elements. Defaults to 1.

    light: LightComponent | null = null

    The light the flare belongs to, or null. See LensFlareOptions.

    node: GraphNode | null = null

    The node whose position is the source, or null. See LensFlareOptions.

    occlusionFade: number = 0.15

    The time the measured visibility takes to follow a change, in seconds, smoothing the flare as the source is covered and uncovered. Zero follows immediately. Defaults to 0.15.

    occlusionOffset: number = 0

    The distance the depth test is moved from the source towards the camera, in world units, so that the geometry of the light itself, such as a bulb, does not occlude its own flare. Defaults to 0.

    occlusionRadius: number = 0.02

    The radius around the source the scene depth is tested in to measure how much of the source is visible, as a fraction of the screen height. The flare fades with the fraction. Defaults to 0.02.

    position: Vec3 | null = null

    The world position of the source, or null. See LensFlareOptions.

    scale: number = 1

    The scale of the flare, multiplying the size of its elements. Defaults to 1.

    useLightColor: boolean = true

    Whether the colour of the light the flare belongs to tints the flare. Defaults to true.