render

package
v0.0.0-...-899be5f Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRayColor

func GetRayColor(r *Ray, bgColor *Vec3, world Hittable, lights Hittable, depth int, rng *RandExt) *Vec3

Types

type Box

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

func MakeBox

func MakeBox(p0, p1 *Point3, m Material) *Box

type Bvh

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

func MakeBvh

func MakeBvh(objects []Hittable, t0, t1 float64, rng *RandExt) *Bvh

func MakeBvhFromList

func MakeBvhFromList(list *HittableList, t0, t1 float64, r *RandExt) *Bvh

type Camera

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

func MakeCamera

func MakeCamera(lookFrom, lookAt *Point3, vup *Vec3, vfov float64, aspectRatio float64, aperture float64, focusDist float64, t1, t2 float64) *Camera

func (*Camera) CastRay

func (c *Camera) CastRay(s, t float64, rng *RandExt) *Ray

type CheckerTexture2d

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

func MakeCheckerTexture2d

func MakeCheckerTexture2d(scale float64, odd, even *Vec3) *CheckerTexture2d

func (*CheckerTexture2d) GetValue

func (this *CheckerTexture2d) GetValue(u, v float64, p *Point3) *Vec3

type CheckerTexture3d

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

func MakeCheckerTexture3d

func MakeCheckerTexture3d(scale float64, odd, even *Vec3) *CheckerTexture3d

func (*CheckerTexture3d) GetValue

func (this *CheckerTexture3d) GetValue(u, v float64, p *Point3) *Vec3

type CosinePdf

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

func MakeCosinePdf

func MakeCosinePdf(w *Vec3) *CosinePdf

type Dielectric

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

func MakeDielectric

func MakeDielectric(ri float64) *Dielectric

func (*Dielectric) Emitted

func (this *Dielectric) Emitted(u, v float64, p *Point3) *Vec3

func (*Dielectric) Scatter

func (this *Dielectric) Scatter(r *Ray, rec *HitRecord, rng *RandExt) (bool, *ScatterRecord)

func (*Dielectric) ScatteringPDF

func (this *Dielectric) ScatteringPDF(r *Ray, rec *HitRecord, scattered *Ray) float64

type DiffuseLight

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

func MakeDiffuseLightFromColor

func MakeDiffuseLightFromColor(c *Vec3) *DiffuseLight

func MakeDiffuseLightFromTexture

func MakeDiffuseLightFromTexture(emit Texture) *DiffuseLight

func (*DiffuseLight) Emitted

func (this *DiffuseLight) Emitted(u, v float64, p *Point3) *Vec3

func (*DiffuseLight) Scatter

func (this *DiffuseLight) Scatter(r *Ray, rec *HitRecord, rng *RandExt) (bool, *ScatterRecord)

func (*DiffuseLight) ScatteringPDF

func (this *DiffuseLight) ScatteringPDF(r *Ray, rec *HitRecord, scattered *Ray) float64

type FlipFace

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

func MakeFlipFace

func MakeFlipFace(obj Hittable) *FlipFace

type HitRecord

type HitRecord struct {
	Material
	// contains filtered or unexported fields
}

func MakeHitRecord

func MakeHitRecord(ray *Ray, root float64, point *Point3, normal *Vec3, material Material, u, v float64) *HitRecord

type Hittable

type Hittable interface {
	// contains filtered or unexported methods
}

func MakeCubeMesh

func MakeCubeMesh(material Material, rng *RandExt) Hittable

func MakeSphereMesh

func MakeSphereMesh(material Material, radius float64, numSegments int, rng *RandExt) Hittable

type HittableList

type HittableList struct {
	Objects []Hittable
}

type HittablePdf

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

func MakeHittablePdf

func MakeHittablePdf(obj Hittable, origin *Point3) *HittablePdf

type ImageTexture

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

func MakeImageTexture

func MakeImageTexture(path string) (*ImageTexture, error)

func (*ImageTexture) GetValue

func (this *ImageTexture) GetValue(u, v float64, p *Point3) *Vec3

type Lambertian

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

func MakeLambertianSolidColor

func MakeLambertianSolidColor(albedo *Vec3) *Lambertian

func MakeLambertianTexture

func MakeLambertianTexture(t Texture) *Lambertian

func (*Lambertian) Emitted

func (this *Lambertian) Emitted(u, v float64, p *Point3) *Vec3

func (*Lambertian) Scatter

func (this *Lambertian) Scatter(r *Ray, rec *HitRecord, rng *RandExt) (bool, *ScatterRecord)

func (*Lambertian) ScatteringPDF

func (this *Lambertian) ScatteringPDF(r *Ray, rec *HitRecord, scattered *Ray) float64

type Material

type Material interface {
	Scatter(r *Ray, rec *HitRecord, rng *RandExt) (bool, *ScatterRecord)
	Emitted(u, v float64, p *Point3) *Vec3
	ScatteringPDF(r *Ray, rec *HitRecord, scattered *Ray) float64
}

type MeshBuilder

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

func MakeMeshBuilder

func MakeMeshBuilder() *MeshBuilder

func (*MeshBuilder) AddPosition

func (this *MeshBuilder) AddPosition(p *Point3) int

func (*MeshBuilder) AddVertex

func (this *MeshBuilder) AddVertex(pos int)

func (*MeshBuilder) BeginPolygon

func (this *MeshBuilder) BeginPolygon()

func (*MeshBuilder) EndPolygon

func (this *MeshBuilder) EndPolygon()

func (*MeshBuilder) GetTriMesh

func (this *MeshBuilder) GetTriMesh(material Material, rng *RandExt) Hittable

type Metal

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

func MakeMetal

func MakeMetal(albedo *Vec3, fuzz float64) *Metal

func (*Metal) Emitted

func (this *Metal) Emitted(u, v float64, p *Point3) *Vec3

func (*Metal) Scatter

func (this *Metal) Scatter(r *Ray, rec *HitRecord, rng *RandExt) (bool, *ScatterRecord)

func (*Metal) ScatteringPDF

func (this *Metal) ScatteringPDF(r *Ray, rec *HitRecord, scattered *Ray) float64

type MixturePdf

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

func MakeMixturePdf

func MakeMixturePdf(a, b Pdf) *MixturePdf

type MovingSphere

type MovingSphere struct {
	Center0, Center1 *Point3
	Radius           float64
	Time0, Time1     float64
	Material
}

type NoiseTexture

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

func MakeNoiseTexture

func MakeNoiseTexture(scale float64, r *RandExt) *NoiseTexture

func (*NoiseTexture) GetValue

func (this *NoiseTexture) GetValue(u, v float64, p *Point3) *Vec3

type Pdf

type Pdf interface {
	// contains filtered or unexported methods
}

type RectXY

type RectXY struct {
	Material
	// contains filtered or unexported fields
}

func MakeRectXY

func MakeRectXY(x0, y0, x1, y1, k float64, m Material) *RectXY

type RectXZ

type RectXZ struct {
	Material
	// contains filtered or unexported fields
}

func MakeRectXZ

func MakeRectXZ(x0, z0, x1, z1, k float64, m Material) *RectXZ

type RectYZ

type RectYZ struct {
	Material
	// contains filtered or unexported fields
}

func MakeRectYZ

func MakeRectYZ(y0, z0, y1, z1, k float64, m Material) *RectYZ

type RotateY

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

func MakeRotateY

func MakeRotateY(obj Hittable, angle float64) *RotateY

type ScatterRecord

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

type SolidColor

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

func MakeSolidColor

func MakeSolidColor(color *Vec3) *SolidColor

func (*SolidColor) GetValue

func (this *SolidColor) GetValue(u, v float64, p *Point3) *Vec3

type Sphere

type Sphere struct {
	Center *Point3
	Radius float64
	Material
}

type Texture

type Texture interface {
	GetValue(u, v float64, p *Point3) *Vec3
}

type Translate

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

func MakeTranslate

func MakeTranslate(obj Hittable, displacement *Vec3) *Translate

type Triangle

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

Jump to

Keyboard shortcuts

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