Create the sun's lens flare
size number optional, default 1Scales every part of it, 1 by default
count number optional, default 7How many ghosts there are along the line, besides the glow at the sun
intensity number optional, default 1How bright it is
saturation number optional, default 1How colorful the ghosts are, 0 for all the flare's own color, 1 a rainbow
color Color optionalTints the whole flare, with the sun's color
new LensFlare3D; // the sun flares
new LensFlare3D(1.5, 10, .7, 0); // bigger, 10 ghosts, dimmer, all one color
How many ghosts there are along the line, besides the glow at the sun
The parts of the flare, to set your own in place of the
ones made from count, seed, saturation, shapes, glowSize and ghostSize
Seconds the flare takes to fade out or in when the sun is hidden or shows again
Scales every part of the flare
Scales the glow at the sun, 0 for none
A light the flare is of in place of the sun, a lamp or a spotlight: the
flare is at the light and in its color, smaller from farther than the light reaches, hidden by what is
in front of the light but its lamp, a mesh around it whose surface is near it, and a spotlight's
shows from inside its beam only; a DirectionalLight3D's is far
away where it shines from, like the sun's; the flare is destroyed when its light is; light.addFlare
sets this
Fade out when something is between the camera and the sun
How colorful the ghosts are, 0 for all the flare's own color, 1 a rainbow
Picks the arrangement of the ghosts, another seed is another flare
The shapes the ghosts are picked from, glow, disc, ring, hex,
streak or star: ['hex'] makes every ghost a hexagon, and a shape listed twice is picked twice as often;
discs, rings and glows when not set
How much of the sun shows, 0 hidden, off the screen or behind the camera to 1 in
plain view, eased; the first update sets it at once, so a sun hidden from the start never shows
The parts of the flare: the elements set by hand, or the ones made from count, seed, saturation, shapes,
glowSize and ghostSize, a glow and a core at the sun and the ghosts, made again when one of those changes
The parts of the flare as they are drawn now: each one's place on the screen, its size in pixels, a vector
when the element's is, and its color, dimmed by how much of the sun shows; empty when there is nothing to draw
Where the sun, or the flare's light, is on the screen, in pixels like mousePosScreen, undefined when it is
behind the camera
Is something between the camera and the sun, or the flare's light: the level, or an object that is not see
through, hit on its triangles as render3D.pick hits it, so a mesh the camera is inside hides nothing unless
it is doubleSided
Draw the flare over the 3D scene, added onto it, called automatically in the 2D pass
A flare has nothing to draw in the 3D pass
Ease visible toward whether the sun shows, called automatically each frame; a flare that would not show
wherever the sun is, off the screen or its light off, looks for nothing in the way