Mesh

Lensflare

Creates a simulated lens flare that tracks a light.

Example

lensflares var light = new v3d.PointLight(0xffffff, 1.5, 2000); var textureLoader = new v3d.TextureLoader(); var textureFlare0 = textureLoader.load("textures/lensflare/lensflare0.png"); var textureFlare1 = textureLoader.load("textures/lensflare/lensflare2.png"); var textureFlare2 = textureLoader.load("textures/lensflare/lensflare3.png"); var lensflare = new v3d.Lensflare(); lensflare.addElement(new v3d.LensflareElement(textureFlare0, 512, 0)); lensflare.addElement(new v3d.LensflareElement(textureFlare1, 512, 0)); lensflare.addElement(new v3d.LensflareElement(textureFlare2, 60, 0.6)); light.add(lensflare);

Constructor

LensflareElement(texture : Texture, size : Float, distance : Float, color : Color, blending : Materials)

texture - v3d.Texture to use for the flare.
size - (optional) size in pixels
distance - (optional) (0-1) from light source (0 = at light source)
color - (optional) the Color of the lens flare
blending - (optional) Blending Mode - Defaults to v3d.NormalBlending

Properties

See the base Mesh class for common properties.

.isLensflare : Boolean

Used to check whether this or derived classes are lensflares. Default is true.

You should not change this, as it used internally for optimisation.

Source

For more info on how to obtain the source code of this module see this page.