sampler

package
v0.0.0-...-d35cbbc Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sampler implements different types of samplers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Albedo

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

Albedo represents an albedo sampler.

func NewAlbedo

func NewAlbedo(numRays *uint64) *Albedo

NewAlbedo returns an instance of the albedo sampler.

func (*Albedo) Sample

func (a *Albedo) Sample(r ray.Ray, world *hitable.HitableSlice, lightShape hitable.Hitable, depth int, random *fastrandom.LCG) *vec3.Vec3Impl

type Colour

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

func NewColour

func NewColour(maxDepth int, background *vec3.Vec3Impl, numRays *uint64) *Colour

func (*Colour) Sample

func (cs *Colour) Sample(r ray.Ray, world *hitable.HitableSlice, lightShape hitable.Hitable, depth int, random *fastrandom.LCG) *vec3.Vec3Impl

type Normal

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

func NewNormal

func NewNormal(numRays *uint64) *Normal

func (*Normal) Sample

func (n *Normal) Sample(r ray.Ray, world *hitable.HitableSlice, lightShape hitable.Hitable, depth int, random *fastrandom.LCG) *vec3.Vec3Impl

type Sampler

type Sampler interface {
	Sample(r ray.Ray, world *hitable.HitableSlice, lightShape hitable.Hitable, depth int, random *fastrandom.LCG) *vec3.Vec3Impl
}

type SamplerType

type SamplerType int
const (
	InvalidSampler SamplerType = iota
	NormalSampler
	ColourSampler
	WireFrameSampler
	AlbedoSampler
)

func StringToType

func StringToType(s string) SamplerType

type WireFrame

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

WireFrame represents a WireFrame sampler.

func NewWireFrame

func NewWireFrame(paper, ink *vec3.Vec3Impl, numRays *uint64) *WireFrame

NewWireFrame returns a new wireframe sampler with the provided colour.

func (*WireFrame) Sample

func (w *WireFrame) Sample(r ray.Ray, world *hitable.HitableSlice, lightShape hitable.Hitable, depth int, random *fastrandom.LCG) *vec3.Vec3Impl

Jump to

Keyboard shortcuts

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