material

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlinnPhongMaterial

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

func (*BlinnPhongMaterial) AmbientOcclusion

func (m *BlinnPhongMaterial) AmbientOcclusion() bool

func (*BlinnPhongMaterial) FragmentShader

func (m *BlinnPhongMaterial) FragmentShader(col color.RGBA, x, n, fN, c math.Vector, ls []light.Source, es []light.Environment) color.RGBA

func (*BlinnPhongMaterial) ReceiveShadow

func (m *BlinnPhongMaterial) ReceiveShadow() bool

func (*BlinnPhongMaterial) Texture

func (m *BlinnPhongMaterial) Texture() *image.Texture

func (*BlinnPhongMaterial) VertexShader

func (m *BlinnPhongMaterial) VertexShader(v primitive.Vertex, uniforms map[string]interface{}) primitive.Vertex

type BlinnPhongMaterialOption

type BlinnPhongMaterialOption func(m *BlinnPhongMaterial)

func WithBlinnPhongAmbientOcclusion

func WithBlinnPhongAmbientOcclusion(enable bool) BlinnPhongMaterialOption

func WithBlinnPhongFactors

func WithBlinnPhongFactors(Kdiff, Kspec float64) BlinnPhongMaterialOption

func WithBlinnPhongFlatShading

func WithBlinnPhongFlatShading(enable bool) BlinnPhongMaterialOption

func WithBlinnPhongShadow

func WithBlinnPhongShadow(enable bool) BlinnPhongMaterialOption

func WithBlinnPhongShininess

func WithBlinnPhongShininess(p float64) BlinnPhongMaterialOption

func WithBlinnPhongTexture

func WithBlinnPhongTexture(tex *image.Texture) BlinnPhongMaterialOption

type Material

type Material interface {
	ReceiveShadow() bool
	AmbientOcclusion() bool
	Texture() *image.Texture
	VertexShader(
		v primitive.Vertex,
		uniforms map[string]interface{},
	) primitive.Vertex
	FragmentShader(col color.RGBA, x, n, fn, camera math.Vector, ls []light.Source, es []light.Environment) color.RGBA
}

Material is an interface that represents a mesh material

func NewBlinnPhong

func NewBlinnPhong(opts ...BlinnPhongMaterialOption) Material

Jump to

Keyboard shortcuts

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