Material

package
v0.0.0-...-9749107 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlendMap Texture.Type = "blendMap"
)

Variables

This section is empty.

Functions

func BindDiffuse

func BindDiffuse(program *ShaderProgram, material *Material, uaMaterial string) error

func BindEmissive

func BindEmissive(program *ShaderProgram, material *Material, uaMaterial string) error

func BindNormals

func BindNormals(program *ShaderProgram, material *Material, uaMaterial string) error

func BindShininess

func BindShininess(program *ShaderProgram, material *Material, uaMaterial string) error

func BindSpecular

func BindSpecular(program *ShaderProgram, material *Material, uaMaterial string) error

Types

type BlendMaterial

type BlendMaterial struct {
	BlendMap  *Texture.Texture2D `yaml:"blendMap"`
	Materials [4]Material        `yaml:"materials"`
}

func (*BlendMaterial) GenerateMibMaps

func (blendMap *BlendMaterial) GenerateMibMaps(lodBias float32)

func (*BlendMaterial) SetWrapMode

func (blendMap *BlendMaterial) SetWrapMode(mode Texture.WrapMode)

func (*BlendMaterial) Unbind

func (blendMap *BlendMaterial) Unbind()

func (*BlendMaterial) UnmarshalYAML

func (blendMap *BlendMaterial) UnmarshalYAML(value *yaml.Node) error

type IMaterial

type IMaterial interface {
	Unbind()

	SetWrapMode(mode Texture.WrapMode)
	GenerateMibMaps(lodBias float32)
}

type Material

type Material struct {
	DiffuseBaseColor  GeometryMath.Vector4 `yaml:"diffuseBaseColor"`
	SpecularBaseColor GeometryMath.Vector3 `yaml:"specularBaseColor"`
	EmissiveBaseColor GeometryMath.Vector3 `yaml:"emissiveBaseColor"`

	Shininess float32 `yaml:"shininess"`

	Textures struct {
		Diffuse  *Texture.Texture2D `yaml:"diffuse"`
		Specular *Texture.Texture2D `yaml:"specular"`
		Emissive *Texture.Texture2D `yaml:"emissive"`
		Normal   *Texture.Texture2D `yaml:"normal"`
	} `yaml:"textures"`

	UvScale float32 `yaml:"uvScale"`
	LodBias float32 `yaml:"lodBias"`
}

func (*Material) Bind

func (material *Material) Bind() error

func (*Material) GenerateMibMaps

func (material *Material) GenerateMibMaps(lodBias float32)

func (*Material) SetWrapMode

func (material *Material) SetWrapMode(mode Texture.WrapMode)

func (*Material) Unbind

func (material *Material) Unbind()

func (*Material) UnmarshalYAML

func (material *Material) UnmarshalYAML(value *yaml.Node) error

type ShaderProgram

type ShaderProgram struct {
	*Shader.ShaderProgramCore

	BindFunctions []func(program *ShaderProgram, material *Material, materialUniformAddress string) error
}

func (*ShaderProgram) BindObject

func (program *ShaderProgram) BindObject(i interface{}) error

func (*ShaderProgram) GetUniformAddress

func (program *ShaderProgram) GetUniformAddress(i interface{}) (string, error)

Jump to

Keyboard shortcuts

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