materials

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Material

type Material struct {
	Name       string
	ShaderProg shaders.ShaderProgram

	UnifLocs   map[string]int32
	AttribLocs map[string]int32

	// Phong shading
	DiffuseTex  uint32
	SpecularTex uint32
	NormalTex   uint32
	EmissionTex uint32

	// Shininess of specular highlights
	Shininess float32

	// Cubemap
	CubemapTex uint32

	// Shadowmaps
	ShadowMap uint32
}

func NewMaterial

func NewMaterial(matName, shaderPath string) *Material

func NewMaterialSrc added in v0.12.12

func NewMaterialSrc(matName string, shaderSrc []byte) *Material

func (*Material) Bind

func (m *Material) Bind()

func (*Material) Delete

func (m *Material) Delete()

func (*Material) DisableAttribute

func (m *Material) DisableAttribute(attribName string)

func (*Material) EnableAttribute

func (m *Material) EnableAttribute(attribName string)

func (*Material) GetAttribLoc

func (m *Material) GetAttribLoc(attribName string) int32

func (*Material) GetUnifLoc added in v0.0.6

func (m *Material) GetUnifLoc(uniformName string) int32

func (*Material) SetUnifFloat32

func (m *Material) SetUnifFloat32(uniformName string, val float32)

func (*Material) SetUnifInt32 added in v0.0.5

func (m *Material) SetUnifInt32(uniformName string, val int32)

func (*Material) SetUnifMat2

func (m *Material) SetUnifMat2(uniformName string, mat2 *gglm.Mat2)

func (*Material) SetUnifMat3

func (m *Material) SetUnifMat3(uniformName string, mat3 *gglm.Mat3)

func (*Material) SetUnifMat4

func (m *Material) SetUnifMat4(uniformName string, mat4 *gglm.Mat4)

func (*Material) SetUnifVec2

func (m *Material) SetUnifVec2(uniformName string, vec2 *gglm.Vec2)

func (*Material) SetUnifVec3

func (m *Material) SetUnifVec3(uniformName string, vec3 *gglm.Vec3)

func (*Material) SetUnifVec4

func (m *Material) SetUnifVec4(uniformName string, vec4 *gglm.Vec4)

func (*Material) UnBind

func (m *Material) UnBind()

type TextureSlot added in v0.21.0

type TextureSlot uint32
const (
	TextureSlot_Diffuse   TextureSlot = 0
	TextureSlot_Specular  TextureSlot = 1
	TextureSlot_Normal    TextureSlot = 2
	TextureSlot_Emission  TextureSlot = 3
	TextureSlot_Cubemap   TextureSlot = 10
	TextureSlot_ShadowMap TextureSlot = 11
)

Jump to

Keyboard shortcuts

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