texture

package
v0.0.0-...-9165eb6 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Overview

Package texture implements different types of textures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker represents a checker board pattern texture.

func NewChecker

func NewChecker(odd Texture, even Texture) *Checker

NewChecker returns a new instance of the Checker texture.

func (*Checker) Value

func (c *Checker) Value(u float64, v float64, p *vec3.Vec3Impl) *vec3.Vec3Impl

type Constant

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

Constant represents a constant texture.

func NewConstant

func NewConstant(color *vec3.Vec3Impl) *Constant

NewConstant returns an instance of the constant texture.

func (*Constant) Value

func (c *Constant) Value(_ float64, _ float64, _ *vec3.Vec3Impl) *vec3.Vec3Impl

type ImageTxt

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

ImageTxt represents an image-based texture.

func NewFromPNG

func NewFromPNG(r io.Reader) (*ImageTxt, error)

NewFromPNG returns a new ImageTxt instance by using the supplied PNG data.

func (*ImageTxt) Value

func (it *ImageTxt) Value(u float64, v float64, p *vec3.Vec3Impl) *vec3.Vec3Impl

type Noise

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

Noise represents a noise texture.

func NewNoise

func NewNoise(scale float64) *Noise

NewNoise returns an instance of the noise texture.

func (*Noise) Value

func (n *Noise) Value(_ float64, _ float64, p *vec3.Vec3Impl) *vec3.Vec3Impl

type Texture

type Texture interface {
	// Value returns the color values at a given point.
	Value(u float64, v float64, p *vec3.Vec3Impl) *vec3.Vec3Impl
}

Texture represents a texture.

Jump to

Keyboard shortcuts

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