Documentation ¶
Index ¶
- Variables
- type AABB
- type BVH
- type Block
- type Checker
- type Color
- type Dielectric
- type Flip
- type HitBoxer
- type HitRecord
- type Image
- type Isotropic
- type Lambertian
- type Light
- type List
- type Material
- type Metal
- type MovingSphere
- type Noise
- type Perlin
- type Rectangle
- type RotateY
- type Solid
- type Sphere
- type Texture
- type Translate
- type Volume
Constants ¶
This section is empty.
Variables ¶
var ( White = NewColor(1.0, 1.0, 1.0) Black = Color{} )
Functions ¶
This section is empty.
Types ¶
type AABB ¶
AABB represents an axis-aligned bounding box.
type Block ¶
type Block struct {
List
}
Block represents a 3-dimensional block or box made up of rectangles.
type Checker ¶
Checker represents a 2-color checkerboard pattern.
func NewChecker ¶
NewChecker returns a new Checker.
type Color ¶
Color represents an RGB color value.
func (Color) PixelValue ¶
PixelValue converts a Color into a pixel value.
type Dielectric ¶
type Dielectric struct { RefIndex float64 // contains filtered or unexported fields }
Dielectric represents a clear material.
func NewDielectric ¶
func NewDielectric(refIndex float64) Dielectric
NewDielectric creates a new material with a given index of refraction.
type Flip ¶
type Flip struct {
Child HitBoxer
}
Flip contains a HitBoxer that can be flipped.
type HitBoxer ¶
type HitBoxer interface { Hit(r *geometry.Ray, tMin float64, tMax float64) (bool, *HitRecord) Box(t0 float64, t1 float64) *AABB }
HitBoxer represents something that can be hit by a ray
type HitRecord ¶
type HitRecord struct { Material Material // the material associated to this record // contains filtered or unexported fields }
type Isotropic ¶
Isotropic represents a material of constant density.
func NewIsotropic ¶
NewIsotropic returns a new Isotropic.
type Lambertian ¶
type Lambertian struct { Albedo Texture // contains filtered or unexported fields }
Lambertian represents a Lambertian material attenuated by an Albedo.
func NewLambertian ¶
func NewLambertian(albedo Texture) Lambertian
NewLambertian creates a new Lambertian material with a given color.
type Light ¶
type Light struct {
Solid Solid
}
Light represents a material that emits light.
type Material ¶
type Material interface { Scatter(r *geometry.Ray, rec *HitRecord) (wasScattered bool, attenuation *Color, scattered *geometry.Ray) Emit(rec *HitRecord) Color }
Material represents a material that scatters light.
type Metal ¶
Metal represents a reflective material.
type MovingSphere ¶
type MovingSphere struct { Center0 geometry.Vec Center1 geometry.Vec T0 float64 T1 float64 Radius float64 Material Material }
MovingSphere represents a sphere that moves from Center0 to Center1 over t0 to t1.
func NewMovingSphere ¶
func NewMovingSphere(center0 geometry.Vec, center1 geometry.Vec, t0 float64, t1 float64, radius float64, material Material) *MovingSphere
NewMovingSphere creates a new Sphere with two centers separated by times t0 and t1.
func (*MovingSphere) Box ¶
func (s *MovingSphere) Box(t0 float64, t1 float64) *AABB
Box returns the bounding box of the MovingSphere.
type Rectangle ¶
Rectangle represents a 2-dimensional rectangle.
func NewRectangle ¶
NewRectangle returns a new Rectangle.
type RotateY ¶
type RotateY struct { Child HitBoxer // contains filtered or unexported fields }
RotateY contains a surface that is rotated along the Y-axis.
func NewRotateY ¶
NewRotateY returns a new RotateY.
type Sphere ¶
Sphere represents a sphere with a Center and a Radius.
type Translate ¶
Translate contains a HitBoxer that is translated according to a vector.
func NewTranslate ¶
NewTranslate returns a new Translate.