Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dielectric ¶
type Dielectric struct {
// contains filtered or unexported fields
}
func (Dielectric) MarshalJSON ¶
func (die Dielectric) MarshalJSON() ([]byte, error)
type Lambertian ¶
type Lambertian struct {
// contains filtered or unexported fields
}
func (Lambertian) MarshalJSON ¶
func (mat Lambertian) MarshalJSON() ([]byte, error)
type Material ¶
type Material interface {
// contains filtered or unexported methods
}
Material defines how a material scatter light
func UnmarshalMaterial ¶
func UnmarshalMaterial(data json.RawMessage) (Material, error)
type Metal ¶
type Metal struct {
// contains filtered or unexported fields
}
func (Metal) MarshalJSON ¶
type Pixels ¶
type Pixels []uint32
Pixels represents the array of pixels (in packed RGB value) to Render and/or save
type Scene ¶
type Scene struct {
// contains filtered or unexported fields
}
Scene represents the scene to Render.
func (*Scene) Render ¶
Render is the main method of a scene. It is non-blocking and returns right away with the array of pixels that will be computed asynchronously and a channel to indicate when the processing is complete. Note that no synchronization is required on the array of pixels since it is an array of 32 bits values. The image (width x height) will be split in lines each one processed in a separate goroutine (parallelCount of them).
type Sphere ¶
type Sphere struct { Center geometry.Point3 `json:"center"` Radius float64 `json:"radius"` Material Material `json:"material"` }
func (*Sphere) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON data into a Sphere object
type World ¶
type World struct { Camera camera.Camera `json:"camera"` Objects HittableList `json:"objects"` }