light

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ambient

type Ambient struct {
	math.TransformContext // not used
	// contains filtered or unexported fields
}

func NewAmbient

func NewAmbient(opts ...AmbientOption) *Ambient

func (*Ambient) Color

func (a *Ambient) Color() color.RGBA

func (*Ambient) Intensity

func (a *Ambient) Intensity() float64

func (*Ambient) Type

func (l *Ambient) Type() object.Type

type AmbientOption

type AmbientOption func(a *Ambient)

func WithAmbientColor

func WithAmbientColor(c color.RGBA) AmbientOption

func WithAmbientIntensity

func WithAmbientIntensity(I float64) AmbientOption

type Environment

type Environment interface {
	object.Object

	Color() color.RGBA
	Intensity() float64
}

Environment represents the abstraction of environment lighting. Such as ambient light, etc.

type Point

type Point struct {
	math.TransformContext
	// contains filtered or unexported fields
}

Point is a point light

func (*Point) CastShadow

func (l *Point) CastShadow() bool

func (*Point) Color

func (l *Point) Color() color.RGBA

func (*Point) Intensity

func (l *Point) Intensity() float64

func (*Point) Position

func (l *Point) Position() math.Vector

func (*Point) Type

func (l *Point) Type() object.Type

type PointOption

type PointOption func(l *Point)

func WithPointLightColor

func WithPointLightColor(c color.RGBA) PointOption

func WithPointLightIntensity

func WithPointLightIntensity(I float64) PointOption

func WithPointLightPosition

func WithPointLightPosition(pos math.Vector) PointOption

func WithShadowMap

func WithShadowMap(enable bool) PointOption

type Source

type Source interface {
	object.Object

	Color() color.RGBA
	Intensity() float64
	Position() math.Vector
	CastShadow() bool
}

Source represents the abstraction of a light source.

func NewPoint

func NewPoint(opts ...PointOption) Source

NewPoint returns a new point light

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL