texture

package
v0.0.0-...-cc5a67f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: CC0-1.0 Imports: 11 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 NewFromHDR

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

NewFromHDR returns a new ImageTxt instance by using the supplied HDR data.

func NewFromPNG

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

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

func (*ImageTxt) FlipX

func (it *ImageTxt) FlipX()

FlipX() flips the image from left to right.

func (*ImageTxt) FlipY

func (it *ImageTxt) FlipY()

FlipY() flips the image upside down.

func (*ImageTxt) SizeX

func (it *ImageTxt) SizeX() int

SizeX returns the width of the underlying image.

func (*ImageTxt) SizeY

func (it *ImageTxt) SizeY() int

SizeX returns the height of the underlying image.

func (*ImageTxt) Value

func (it *ImageTxt) Value(u float64, v float64, _ *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.

type UV

type UV struct {
	U float64
	V float64
}

UV represents a UV pair.

Jump to

Keyboard shortcuts

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