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 (l *Spot) AngularDecay() float32
- func (l *Spot) Color() math32.Color
- func (l *Spot) CutoffAngle() float32
- func (l *Spot) Intensity() float32
- func (l *Spot) LinearDecay() float32
- func (l *Spot) QuadraticDecay() float32
- func (l *Spot) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo, idx int)
- func (l *Spot) SetAngularDecay(decay float32)
- func (l *Spot) SetColor(color *math32.Color)
- func (l *Spot) SetCutoffAngle(angle float32)
- func (l *Spot) SetIntensity(intensity float32)
- func (l *Spot) SetLinearDecay(decay float32)
- func (l *Spot) SetQuadraticDecay(decay float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ambient ¶
Ambient represents an ambient light
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 ¶
Directional represents a directional, positionless light
func NewDirectional ¶
func NewDirectional(color *math32.Color, intensity float32) *Directional
NewDirectional creates and returns a pointer of a new directional light the specified color and intensity.
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 ¶
Point is an omnidirectional light source
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 ¶
Spot represents a spotlight
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) 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) 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