Documentation ¶
Overview ¶
Package light provides light sources and shading.
Package light provides different types of light sources and behavior using light.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lighting ¶
func Lighting(mat *material.Material, light *PointLight, pt *point.Point, eyeVec, normalVec *vector.Vector, inShadow bool) *color.Color
Lighting computes the shading for a material given the light source, point being illuminated, eye and normal vectors, and shadow flag using the Phong reflection model.
Types ¶
type PointLight ¶
PointLight represents a point light source that exists at a single point in 3D space. The point light source has an Intensity which describes the color of the light source and how bright it is.
func NewPointLight ¶
func NewPointLight(position point.Point, intensity color.Color) *PointLight
NewPointLight returns a new PointLight having the passed Position and Intensity.
Click to show internal directories.
Click to hide internal directories.