class FoxBaseLight
package foxlite.lights
extends FoxObject › FoxBasic
extended by FoxDirectionalLight, FoxPointLight, FoxSpotLight
Constructor
new(x:Float = 0, y:Float = 0, z:Float = 0, color:FlxColor = 0xFFFFFFFF, energy:Float = 1, shadow:Bool = false)
Variables
shadow:Bool
If true, this light will cast shadows
Note: If this is set to true, a new texture will be created for this light, this is its shadow map, and it's currently a fixed resolution of 1024x1024
shadowAtlasRect:Vector3D = new Vector3D(0, 0, 1, 1)
Temporary value to store the region of the shadowmap for this light.
This is handled automatically by FoxLightData
Note: This is a Vector3D instead of a Rectangle for fast scaling operations in HScript
shadowAtlasUV:Vector3D = new Vector3D(0, 0, 1, 1)
Same as shadowAtlasRect but as UV coordinates for the shader.
projectionMatrix:Matrix3D = new Matrix3D()
The projection matrix for this light
A Directional Light has an Orthogonal projection, this means the rays are always parallel to the surface, this is used to simulate the sun shadows.
A Point light has a Perspective projection, this means the rays have a depth to them the farther away they are from the light source. This is used to simulate point light source shadows.
viewMatrix:Matrix3D = new Matrix3D()
The view matrix for this light
This is its transform for its POV
viewProjection:Matrix3D = new Matrix3D()
The Transform of this light with its Projection
This is necessary for shadow calculations in the fragment shader, as it's the POV of the light