raytrace

package
v0.0.0-...-9c88ebf Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	*Intersection
}

type Frame

type Frame struct {
	*scene.Frame
	*RayFrame
}

func (*Frame) Image

func (sf *Frame) Image(img *image.RGBA) *image.RGBA

func (*Frame) PopulateIntersectors

func (sf *Frame) PopulateIntersectors()

func (*Frame) PopulateShaders

func (sf *Frame) PopulateShaders()

type Intersector

type Intersector struct {
	scene.TriangleIndex
	*triangle.TriangleIntersector
}

type Material

type Material struct {
	Color    *material.Color
	Luminous float64
	Diffuse  angle.Rad
}

type MaterialWrapper

type MaterialWrapper struct {
	// contains filtered or unexported fields
}

func NewMaterialWrapper

func NewMaterialWrapper(m material.Material) *MaterialWrapper

func (*MaterialWrapper) RayShader

func (m *MaterialWrapper) RayShader(ctx *Context) *Material

type ModelIntersector

type ModelIntersector struct {
	*box.Box
	Intersectors []Intersector
}

type RayFrame

type RayFrame struct {
	Background   Shader
	Shaders      []Shader
	Depth        int
	RayMult      int
	ImageScale   float64
	Intersectors []ModelIntersector
}

type RayShader

type RayShader interface {
	RayShader(*Context) *Material
}

type Scene

type Scene struct {
	*scene.Scene
	*RayFrame
}

func (*Scene) Frame

func (f *Scene) Frame(idx int, img image.Image) (image.Image, error)

type Shader

type Shader func(*Context) *Material

Jump to

Keyboard shortcuts

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