Documentation
¶
Index ¶
- func GetRandomCosineDirection() mgl64.Vec3
- func PerlinNoise(p mgl64.Vec3, interpolate bool) float64
- func PerlinVectorNoise(p mgl64.Vec3) float64
- func PerlinVectorTurbulence(p mgl64.Vec3) float64
- func PerlinVectorTurbulenceCustomDepth(p mgl64.Vec3, depth int) float64
- func RandomToSphere(radius float64, distanceSquared float64) mgl64.Vec3
- type AABB
- type BackgroundFunc
- type Camera
- type ColorVector
- func (c ColorVector) Add(other ColorVector) ColorVector
- func (c ColorVector) ApplyGamma2() ColorVector
- func (c ColorVector) B() float64
- func (c ColorVector) Clamp() ColorVector
- func (c ColorVector) DivScalar(other float64) ColorVector
- func (c ColorVector) G() float64
- func (c ColorVector) Mul(other ColorVector) ColorVector
- func (c ColorVector) MulScalar(other float64) ColorVector
- func (c ColorVector) R() float64
- func (c ColorVector) RGBA() (r, g, b, a uint32)
- type CosinePdf
- type HitRecord
- type Hitable
- type HitablePdf
- type Material
- type MixturePdf
- type MonteCarloTracer
- type OrthoNormalBase
- type Pdf
- type PixelBuffer
- type Ray
- type RayTracer
- type RenderConfig
- type Renderer
- type ScatterResult
- type Scene
- type Texture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerlinVectorNoise ¶
func PerlinVectorTurbulence ¶
Types ¶
type AABB ¶
type AABB struct {
// contains filtered or unexported fields
}
func (*AABB) GetSurroundingBox ¶
type BackgroundFunc ¶
type BackgroundFunc func(ray *Ray) ColorVector
type ColorVector ¶
type ColorVector struct {
// contains filtered or unexported fields
}
func NewColorVector ¶
func NewColorVector(r float64, g float64, b float64) ColorVector
func NewColorVectorFromRGBA ¶
func NewColorVectorFromRGBA(r uint32, g uint32, b uint32, a uint32) ColorVector
func (ColorVector) Add ¶
func (c ColorVector) Add(other ColorVector) ColorVector
func (ColorVector) ApplyGamma2 ¶
func (c ColorVector) ApplyGamma2() ColorVector
func (ColorVector) B ¶
func (c ColorVector) B() float64
func (ColorVector) Clamp ¶
func (c ColorVector) Clamp() ColorVector
func (ColorVector) DivScalar ¶
func (c ColorVector) DivScalar(other float64) ColorVector
func (ColorVector) G ¶
func (c ColorVector) G() float64
func (ColorVector) Mul ¶
func (c ColorVector) Mul(other ColorVector) ColorVector
func (ColorVector) MulScalar ¶
func (c ColorVector) MulScalar(other float64) ColorVector
func (ColorVector) R ¶
func (c ColorVector) R() float64
func (ColorVector) RGBA ¶
func (c ColorVector) RGBA() (r, g, b, a uint32)
type HitRecord ¶
type HitRecord struct {
// contains filtered or unexported fields
}
func NewHitRecord ¶
type Hitable ¶
type Hitable interface {
Hit(ray *Ray, tMin float64, tMax float64) *HitRecord
GetBoundingBox(t0 float64, t1 float64) *AABB
GetPdfValue(origin mgl64.Vec3, v mgl64.Vec3) float64
Random(origin mgl64.Vec3) mgl64.Vec3
}
Hitable go
type HitablePdf ¶
type HitablePdf struct {
// contains filtered or unexported fields
}
func (*HitablePdf) Generate ¶
func (p *HitablePdf) Generate() mgl64.Vec3
type MixturePdf ¶
type MixturePdf struct {
// contains filtered or unexported fields
}
func (*MixturePdf) Generate ¶
func (p *MixturePdf) Generate() mgl64.Vec3
type MonteCarloTracer ¶
type MonteCarloTracer struct {
// contains filtered or unexported fields
}
func (*MonteCarloTracer) Configure ¶
func (t *MonteCarloTracer) Configure( imageWidth int, imageHeight int, camera Camera, world Hitable, lightHitable Hitable, renderConfig *RenderConfig, backgroundFunc BackgroundFunc)
func (*MonteCarloTracer) GetPixelColor ¶
func (t *MonteCarloTracer) GetPixelColor(x int, y int) ColorVector
type OrthoNormalBase ¶
type OrthoNormalBase struct {
// contains filtered or unexported fields
}
func OrthoNormalBaseFromW ¶
func OrthoNormalBaseFromW(n mgl64.Vec3) *OrthoNormalBase
func (*OrthoNormalBase) W ¶
func (onb *OrthoNormalBase) W() mgl64.Vec3
type PixelBuffer ¶
type PixelBuffer struct {
// contains filtered or unexported fields
}
func LoadPixelBuffer ¶
func LoadPixelBuffer(imagePath string) *PixelBuffer
func NewPixelBuffer ¶
func NewPixelBuffer(width int, height int) *PixelBuffer
func (*PixelBuffer) GetImage ¶
func (buf *PixelBuffer) GetImage() *image.RGBA
func (*PixelBuffer) GetPixelColor ¶
func (buf *PixelBuffer) GetPixelColor(x int, y int) ColorVector
func (*PixelBuffer) Height ¶
func (buf *PixelBuffer) Height() int
func (*PixelBuffer) SavePng ¶
func (buf *PixelBuffer) SavePng(path string)
func (*PixelBuffer) SetPixelColor ¶
func (buf *PixelBuffer) SetPixelColor(x int, y int, clr ColorVector)
func (*PixelBuffer) Width ¶
func (buf *PixelBuffer) Width() int
type Ray ¶
type Ray struct {
// contains filtered or unexported fields
}
Ray todo
func (*Ray) GetPointAtParameter ¶
GetPointAtParameter todo
type RayTracer ¶
type RayTracer interface {
Configure(
imageWidth int,
imageHeight int,
camera Camera,
world Hitable,
lightHitable Hitable,
renderConfig *RenderConfig,
backgroundFunc BackgroundFunc)
GetPixelColor(x int, y int) ColorVector
}
func NewMonteCarloTracer ¶
func NewMonteCarloTracer() RayTracer
func NewSimpleTracer ¶
func NewSimpleTracer() RayTracer
type RenderConfig ¶
type RenderConfig struct {
// contains filtered or unexported fields
}
func NewRenderConfig ¶
func NewRenderConfig(maxDepth int, samplesPerPixel int, isTwoPhase bool) *RenderConfig
func (*RenderConfig) IsTwoPhase ¶
func (c *RenderConfig) IsTwoPhase() bool
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
func NewRenderer(config *RenderConfig) *Renderer
func (*Renderer) Render ¶
func (r *Renderer) Render(rayTracer RayTracer, pixelBuffer *PixelBuffer, scene Scene, renderConfig *RenderConfig)
type ScatterResult ¶
type ScatterResult struct {
// contains filtered or unexported fields
}
func NewFalseScatterResult ¶
func NewFalseScatterResult() *ScatterResult
func NewScatterResult ¶
func NewScatterResult(isScattered bool, attenuation ColorVector, specularRay *Ray, pdf Pdf) *ScatterResult
func (*ScatterResult) Attenuation ¶
func (r *ScatterResult) Attenuation() ColorVector
func (*ScatterResult) IsScattered ¶
func (r *ScatterResult) IsScattered() bool
func (*ScatterResult) IsSpecular ¶
func (r *ScatterResult) IsSpecular() bool
func (*ScatterResult) Pdf ¶
func (r *ScatterResult) Pdf() Pdf
func (*ScatterResult) SpecularRay ¶
func (r *ScatterResult) SpecularRay() *Ray
Source Files
¶
Click to show internal directories.
Click to hide internal directories.