Type Alias ParticleLayerOptions
angleDirectionShiftSkip?: number;
color?: RgbaColor;
decodeAsWaves?: boolean;
decodeChannels?: string;
decodeMagnitudeMax?: number;
decodeMax: number;
decodeMin: number;
density?: number;
drawAsLines?: boolean;
fadeFactor?: number;
fastColor?: RgbaColor;
fastIsLarger?: boolean;
fastSpeed?: number;
fieldColorMax?: number;
fieldColorMin?: number;
maxAmount?: number;
pixelRatio?: number;
refreshInterval?: number;
renderTrails?: boolean;
size?: number;
speed?: number;
uniformSpeed?: boolean;
useAlphaAsMask?: boolean;
}
Index
Properties
Properties
OptionalangleDirectionShiftSkip
This angle respresents the change of direction of a particle between a render call and the next. If a particle
changes direction abruptly with an angle greater than angleDirectionShiftSkip, then it is no longer rendered.
A value of 30 (degrees) is a good compromise to reduce the "splashing" effect particle can have on the
side of hurricanes at semi-global-scale zoom level.
Default: 90 (no skipping unless the particle changes direction to go backward between two render calls, which is unlikely)
Optionalcolor
Color of the particle. RGBA 0-255. Defaults to [255, 255, 255, 192]
OptionaldecodeAsWaves
Decode the channels as "direction + period" rather than "UV".
If true, the first channel is assumed to be direction (0-360deg) and the second to be the period (1/speed).
OptionaldecodeChannels
Channels to read the UV values from. Defaults to rg
OptionaldecodeMagnitudeMax
Upper bound on the magnitude of the decoded field vector when packing a normalized scalar into the second particle RTT attachment (for coloring). Defaults to √2 × max(|decodeMin|, |decodeMax|), a safe upper bound when each channel lies in [decodeMin, decodeMax].
decodeMax
Maximum encoded value.
decodeMin
Minimum encoded value.
Optionaldensity
Number of particles visible per 1000 px^2. Default is 2.
OptionaldrawAsLines
Draw the particles as lines (size is length). Defaults to false.
OptionalfadeFactor
How much the particles fade over time.
Default value is 0.1.
OptionalfastColor
Color of the particle when moving "fast". RGBA 0-255. Defaults to color
OptionalfastIsLarger
If this is true, the particles gets slighly larger as they become faster.
Default: false
OptionalfastSpeed
What is considered "fast" (in px/sec) for coloring purposes. Only makes sense when fastColor is used.
OptionalfieldColorMax
Upper bound (inclusive) for full fastColor: at or above this, the fast color is used. Between min and max, colors interpolate linearly. Defaults to decodeMagnitudeMax when omitted.
OptionalfieldColorMin
Lower bound (inclusive) of decoded scalar magnitude for particle color: at or below this, color is used.
Must be >= 0. Defaults to 0.
OptionalmaxAmount
Quantity of particles to be created. Default value is 128.
Has to be a power of 2 and at least 4.
The actual exact number will be particles * particles.
Try to keep this value as low as possible to optimize performance.
The number of actually visible particles is determined by density.
OptionalpixelRatio
Use more pixels to make particles more smooth (especially when tilted).
Defaults to 2 for normal displays and 1 for HiDPI displays.
OptionalrefreshInterval
Time interval (in milliseconds) how often the particles
are refreshed to avoid degradation.
Random 1/16 of the particles is always randomly reset.
Default value is 800.
OptionalrenderTrails
Render the trails of the particles. Defaults to true.
Optionalsize
Size of the particle. Defaults to 1
Optionalspeed
Speed factor of the particles. Defaults to 0.001
OptionaluniformSpeed
When true, the speed of particles (and trail length) will be the same in number of pixel traveled per second, regardless of the
size of the screen, which is convenient to provide a comparable experience on mobile/desktop.
If disabled, the particles will be slower and with a shorter trail on smalled screen such as mobile.
Default: false
OptionaluseAlphaAsMask
If true, the particles will only be displayed where the alpha channel is 255.
This is to be set to true for tilesets that do not cover the entire globe.
Default value is false.
Options specific to the particle visualization