tracing

package
v0.0.0-...-da3de13 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_RECURSION int = 2
View Source
const REFRACTION_INDEX_AIR float32 = 1.0

Variables

This section is empty.

Functions

This section is empty.

Types

type CameraConfig

type CameraConfig struct {
	Left, Right, Top, Bottom float32
	PointOfView              vecmath.Vec3d
}

type Engine

type Engine interface {

	// Return closest object intersecting ray if any, nil otherwise.
	// If there is an intersection, also return distance to ray origin
	FindClosestObject(ray *scene.Ray) (*scene.Traceable, float32)

	// Return whether ray hits any object. This is an optimization for the
	// shadow calculations, where the search can be aborted as soon as any
	// occluding object is found
	FindOccluder(ray *scene.Ray, lightDistance float32) bool
}

type RayTracer

type RayTracer struct {
	Width, Height int
	Camera        CameraConfig
	Scene         *Scene
	// contains filtered or unexported fields
}

func (*RayTracer) Render

func (self *RayTracer) Render(tileSize int) image.Image

type Scene

type Scene struct {
	Traceables []*scene.Traceable
	Lights     []*scene.LightSource

	BackgroundColor color.RGBA
}

Data model for scene description

func (*Scene) AddLight

func (self *Scene) AddLight(light scene.LightSource)

func (*Scene) AddObject

func (self *Scene) AddObject(object scene.Traceable)

func (*Scene) ToOctree

func (self *Scene) ToOctree() spatial.Octree

Jump to

Keyboard shortcuts

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