Documentation ¶
Overview ¶
Package light contains common light types which can be add to a 3D scene to illuminate it.
Index ¶
- type Ambient
- type Directional
- type ILight
- type Point
- func (lp *Point) Color() math32.Color
- func (lp *Point) Intensity() float32
- func (lp *Point) LinearDecay() float32
- func (lp *Point) QuadraticDecay() float32
- func (lp *Point) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
- func (lp *Point) SetColor(color *math32.Color)
- func (lp *Point) SetIntensity(intensity float32)
- func (lp *Point) SetLinearDecay(decay float32)
- func (lp *Point) SetQuadraticDecay(decay float32)
- type Spot
- func (sl *Spot) AngularDecay() float32
- func (sl *Spot) Color() math32.Color
- func (sl *Spot) CutoffAngle() float32
- func (sp *Spot) Direction(direction *math32.Vector3) math32.Vector3
- func (sl *Spot) Intensity() float32
- func (sl *Spot) LinearDecay() float32
- func (sl *Spot) QuadraticDecay() float32
- func (sl *Spot) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
- func (sl *Spot) SetAngularDecay(decay float32)
- func (sl *Spot) SetColor(color *math32.Color)
- func (sl *Spot) SetCutoffAngle(angle float32)
- func (sp *Spot) SetDirection(direction *math32.Vector3)
- func (sl *Spot) SetIntensity(intensity float32)
- func (sl *Spot) SetLinearDecay(decay float32)
- func (sl *Spot) SetQuadraticDecay(decay float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ambient ¶
func NewAmbient ¶
NewAmbient returns a pointer to a new ambient color with the specified color and intensity
func (*Ambient) RenderSetup ¶
RenderSetup is called by the engine before rendering the scene
func (*Ambient) SetIntensity ¶
SetIntensity sets the intensity of this light
type Directional ¶
func NewDirectional ¶
func NewDirectional(color *math32.Color, intensity float32) *Directional
func (*Directional) Color ¶
func (ld *Directional) Color() math32.Color
Color returns the current color of this light
func (*Directional) Intensity ¶
func (ld *Directional) Intensity() float32
Intensity returns the current intensity of this light
func (*Directional) RenderSetup ¶
func (ld *Directional) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
RenderSetup is called by the engine before rendering the scene
func (*Directional) SetColor ¶
func (ld *Directional) SetColor(color *math32.Color)
SetColor sets the color of this light
func (*Directional) SetIntensity ¶
func (ld *Directional) SetIntensity(intensity float32)
SetIntensity sets the intensity of this light
type ILight ¶
type ILight interface {
RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
}
ILight is the interface that must be implemented for all light types.
type Point ¶
func (*Point) LinearDecay ¶
LinearDecay returns the current linear decay factor
func (*Point) QuadraticDecay ¶
QuadraticDecay returns the current quadratic decay factor
func (*Point) RenderSetup ¶
RenderSetup is called by the engine before rendering the scene
func (*Point) SetIntensity ¶
SetIntensity sets the intensity of this light
func (*Point) SetLinearDecay ¶
SetLinearDecay sets the linear decay factor as a function of the distance
func (*Point) SetQuadraticDecay ¶
SetQuadraticDecay sets the quadratic decay factor as a function of the distance
type Spot ¶
func (*Spot) AngularDecay ¶
AngularDecay returns the current angular decay exponent
func (*Spot) CutoffAngle ¶
CutoffAngle returns the current cutoff angle in degrees from 0 to 90
func (*Spot) Direction ¶
Direction returns the current direction of this spot light in world coordinates
func (*Spot) LinearDecay ¶
LinearDecay returns the current linear decay factor
func (*Spot) QuadraticDecay ¶
QuadraticDecay returns the current quadratic decay factor
func (*Spot) RenderSetup ¶
RenderSetup is called by the engine before rendering the scene
func (*Spot) SetAngularDecay ¶
SetAngularDecay sets the angular decay exponent
func (*Spot) SetCutoffAngle ¶
SetCutoffAngle sets the cutoff angle in degrees from 0 to 90
func (*Spot) SetDirection ¶
SetDirection sets the direction of the spot light in world coordinates
func (*Spot) SetIntensity ¶
SetIntensity sets the intensity of this light
func (*Spot) SetLinearDecay ¶
SetLinearDecay sets the linear decay factor as a function of the distance
func (*Spot) SetQuadraticDecay ¶
SetQuadraticDecay sets the quadratic decay factor as a function of the distance