Documentation ¶
Overview ¶
Package material provides material and texture related types and functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HitRecord ¶
type HitRecord struct { HitPoint geo.Vec3 Normal geo.Vec3 Material Material RayLength float64 U float64 V float64 FrontFace bool }
HitRecord is a collection of all interesting properties from when a ray hits a hittable object
type Isotropic ¶
type Isotropic struct { NonLightEmittingMaterial Albedo Texture }
Isotropic is a fog type material Should not be used directly, but is used internally by ConstantMedium hittable
type LightEmittingMaterial ¶ added in v0.0.7
LightEmittingMaterial is a material that can emit light
type Material ¶
type Material interface { PdfGeneratingMaterial LightEmittingMaterial IsLight() bool Scatter(rayIn geo.Ray, rec *HitRecord) (bool, ScatterRecord) }
Material is the interface for types that describe how a ray behaves when hitting an object.
func NewDielectric ¶ added in v0.3.5
NewDielectric creates a new dielectric material
func NewLambertian ¶ added in v0.3.5
NewLambertian creates a lambertian material
type NonLightEmittingMaterial ¶ added in v0.0.7
type NonLightEmittingMaterial struct{}
NonLightEmittingMaterial is to be used by materials that do not emit light
func (NonLightEmittingMaterial) Emitted ¶ added in v0.0.7
func (m NonLightEmittingMaterial) Emitted(rec *HitRecord) geo.Vec3
Emitted a non emitting material emits zero light
func (NonLightEmittingMaterial) IsLight ¶ added in v0.3.5
func (m NonLightEmittingMaterial) IsLight() bool
IsLight a non emitting material is not a light
type NonPdfGeneratingMaterial ¶ added in v0.0.7
type NonPdfGeneratingMaterial struct{}
NonPdfGeneratingMaterial is to be used by materials that do not use pdfs
func (NonPdfGeneratingMaterial) ScatteringPdf ¶ added in v0.0.7
func (m NonPdfGeneratingMaterial) ScatteringPdf(rec *HitRecord, scattered geo.Ray) float64
ScatteringPdf as NonPdfGeneratingMaterial is used for materials that do not generate a pdf Just return 0
type PdfGeneratingMaterial ¶ added in v0.0.7
PdfGeneratingMaterial is a material that can use pdfs for scattering of rays
type ScatterRecord ¶ added in v0.0.7
ScatterRecord is a collection of attributes from the scattering of a ray with a material
type SolidColor ¶
SolidColor is a texture with just the same color everywhere
type Texture ¶
Texture describes the color of a material. The color can vary by the uv coordinates of the hittable
func LoadImageTexture ¶ added in v0.3.5
LoadImageTexture creates a texture that uses image data for color by loading the image from the path
func NewImageTexture ¶ added in v0.3.4
NewImageTexture creates a texture that uses image data for color