light

package
v0.0.0-...-1b60a0e Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 5 Imported by: 0

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

type PointLight struct {
	Position  point.Point
	Intensity color.Color
}

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.

Jump to

Keyboard shortcuts

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