struct
Eagle::LightData
- Eagle::LightData
- Struct
- Value
- Object
Overview
A light as the renderer sees it. The light nodes produce these each frame.
Defined in:
eagle/graphics3d/renderer3d.crConstructors
-
.directional(direction : Vec3, color : Color = Color::WHITE, intensity : Number = 1, shadows : Bool = true) : LightData
A directional light.
-
.new(kind : Eagle::LightData::Kind, position : Eagle::Vec3, direction : Eagle::Vec3, color : Eagle::Color, intensity : Float32, range : Float32 = 10_f32, spot_inner : Float32 = 0.5_f32, spot_outer : Float32 = 0.6_f32, shadows : Bool = false)
Creates light data.
-
.point(position : Vec3, color : Color = Color::WHITE, intensity : Number = 1, range : Number = 10) : LightData
A point light.
-
.spot(position : Vec3, direction : Vec3, color : Color = Color::WHITE, intensity : Number = 1, range : Number = 10, angle : Number = 0.6, softness : Number = 0.1) : LightData
A spot light.
Instance Method Summary
-
#color : Color
Light color.
-
#direction : Vec3
Direction, for directional and spot lights.
-
#intensity : Float32
Brightness multiplier.
-
#kind : Kind
The kind of light.
-
#position : Vec3
World position, for point and spot lights.
-
#range : Float32
Distance at which point and spot lights fade out.
-
#shadows? : Bool
Whether the light casts shadows.
-
#spot_inner : Float32
Cosine of the angle where a spot light starts to fade.
-
#spot_outer : Float32
Cosine of the angle where a spot light is fully dark.
Constructor Detail
def self.directional(direction : Vec3, color : Color = Color::WHITE, intensity : Number = 1, shadows : Bool = true) : LightData
#
A directional light.
def self.new(kind : Eagle::LightData::Kind, position : Eagle::Vec3, direction : Eagle::Vec3, color : Eagle::Color, intensity : Float32, range : Float32 = 10_f32, spot_inner : Float32 = 0.5_f32, spot_outer : Float32 = 0.6_f32, shadows : Bool = false)
#
Creates light data. Prefer .directional, .point or .spot.
def self.point(position : Vec3, color : Color = Color::WHITE, intensity : Number = 1, range : Number = 10) : LightData
#
A point light.
def self.spot(position : Vec3, direction : Vec3, color : Color = Color::WHITE, intensity : Number = 1, range : Number = 10, angle : Number = 0.6, softness : Number = 0.1) : LightData
#
A spot light.