hex-world
    Preparing search index...

    Interface GodRaysOptions

    God-ray styling. Unset fields keep their current value.

    interface GodRaysOptions {
        sky?: SkyDome | null;
        enabled?: boolean;
        intensity?: number;
        density?: number;
        decay?: number;
        samples?: number;
        resolutionScale?: number;
        color?: ColorRepresentation | null;
        exclude?: Iterable<Object3D<Object3DEventMap>, any, any>;
    }
    Index

    Properties

    sky?: SkyDome | null

    The sky dome the shafts belong to. Two jobs: its mesh is kept out of the occlusion pass (the sky is what the rays are made of, not something that blocks them), and its overcast factor gates them, so a storm puts them out along with the sun disc. Without one, feed overcast via GodRays.setOvercast.

    enabled?: boolean

    Draw the rays. Default true.

    intensity?: number

    Brightness added where the line to the sun is completely open — i.e. the value the shafts reach right at the sun disc, before the daylight and overcast gates. Default 0.55.

    density?: number

    How far along the line to the sun a pixel gathers, as a fraction of that whole distance. 1 marches the full span for long shafts; lower values keep the glow tight around the sun. Default 1.

    decay?: number

    Per-sample falloff, 0–1. The shafts' length: 0.9 is a short flare, 0.97 throws light most of the way across the frame. Default 0.93.

    samples?: number

    Samples marched per pixel. The one real cost knob — 28 is smooth at quarter resolution, 16 is visibly noisier but half the price. Changing it rebuilds the shader. Default 28.

    resolutionScale?: number

    Occlusion buffer size as a fraction of the drawing buffer. The mask is blurred along its whole length anyway, so there is nothing to gain from detail here. Default 0.25.

    color?: ColorRepresentation | null

    Ray color. Null (the default) follows the sun's own color, so the shafts go orange at dawn along with the light and the horizon.

    exclude?: Iterable<Object3D<Object3DEventMap>, any, any>

    Objects that must not block the light: particles, screen-space overlays, anything drawn without depth. The attached sky's dome is excluded for you.