render

package
v0.0.0-...-2e574ad Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgParse

func ArgParse() (nThread int, csvFile string, outFile string)

func RandomScene

func RandomScene(csvPath string) *pm.World

RandomScene returns a 'random' scene

func SceneParser

func SceneParser(csvPath string) *pm.World

Types

type Pixel

type Pixel struct {
	X, Y  int
	Color *color.RGBA64
}

type Sampler

type Sampler struct {
	ImgOut *image.RGBA64
	// contains filtered or unexported fields
}

Sampler performs the color sampling on pixel level

func NewSampler

func NewSampler(width, height, finess, maxDepth int, tMin float64, seed ...int) *Sampler

NewSampler creates a new sampler for rendering

func (*Sampler) Render

func (s *Sampler) Render()

func (*Sampler) SamplePixel

func (s *Sampler) SamplePixel(x, y int) color.RGBA64

SamplePixel yields the color for given coordinate (x, y)

func (*Sampler) Save

func (s *Sampler) Save(filePath string) error

Save saves the image to the given file

func (*Sampler) SetCamera

func (s *Sampler) SetCamera(fov, aspect, aperture float64, pos, lookAt, up *vec3.Vec3)

SetCamera customize the camera model with given parameters ** lookAt is a point

func (*Sampler) SetParallel

func (s *Sampler) SetParallel(nThread int)

func (*Sampler) SetWorldObj

func (s *Sampler) SetWorldObj(world *pm.World)

SetWorldObj sets up the world of hitable objects

Jump to

Keyboard shortcuts

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