Documentation ¶
Index ¶
- func SetUnifMat2(shaderProgId uint32, unifLoc int32, mat2 *gglm.Mat2)
- func SetUnifMat3(shaderProgId uint32, unifLoc int32, mat3 *gglm.Mat3)
- func SetUnifMat4(shaderProgId uint32, unifLoc int32, mat4 *gglm.Mat4)
- func SetUnifVec2(shaderProgId uint32, unifLoc int32, vec2 *gglm.Vec2)
- func SetUnifVec3(shaderProgId uint32, unifLoc int32, vec3 *gglm.Vec3)
- func SetUnifVec4(shaderProgId uint32, unifLoc int32, vec4 *gglm.Vec4)
- type Material
- func (m *Material) Bind()
- func (m *Material) Delete()
- func (m *Material) DisableAttribute(attribName string)
- func (m *Material) EnableAttribute(attribName string)
- func (m *Material) GetAttribLoc(attribName string) int32
- func (m *Material) GetUnifLoc(uniformName string) int32
- func (m *Material) SetUnifFloat32(uniformName string, val float32)
- func (m *Material) SetUnifInt32(uniformName string, val int32)
- func (m *Material) SetUnifMat2(uniformName string, mat2 *gglm.Mat2)
- func (m *Material) SetUnifMat3(uniformName string, mat3 *gglm.Mat3)
- func (m *Material) SetUnifMat4(uniformName string, mat4 *gglm.Mat4)
- func (m *Material) SetUnifVec2(uniformName string, vec2 *gglm.Vec2)
- func (m *Material) SetUnifVec3(uniformName string, vec3 *gglm.Vec3)
- func (m *Material) SetUnifVec4(uniformName string, vec4 *gglm.Vec4)
- func (m *Material) SetUniformBlockBindingPoint(uniformBlockName string, bindPointIndex uint32)
- func (m *Material) UnBind()
- type MaterialSettings
- type TextureSlot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetUnifMat2 ¶ added in v0.26.0
func SetUnifMat3 ¶ added in v0.26.0
func SetUnifMat4 ¶ added in v0.26.0
func SetUnifVec2 ¶ added in v0.26.0
func SetUnifVec3 ¶ added in v0.26.0
Types ¶
type Material ¶
type Material struct { Id uint32 Name string ShaderProg shaders.ShaderProgram Settings MaterialSettings UnifLocs map[string]int32 AttribLocs map[string]int32 // @TODO: Do this in a better way?. Perhaps something like how we do fbo attachments? Or keep it? // Phong shading DiffuseTex uint32 SpecularTex uint32 NormalTex uint32 EmissionTex uint32 // Shininess of specular highlights Shininess float32 // Cubemaps CubemapTex uint32 CubemapArrayTex uint32 // Shadowmaps ShadowMapTex1 uint32 ShadowMapTexArray1 uint32 }
func NewMaterial ¶
func NewMaterialSrc ¶ added in v0.12.12
func (*Material) DisableAttribute ¶
func (*Material) EnableAttribute ¶
func (*Material) GetAttribLoc ¶
func (*Material) GetUnifLoc ¶ added in v0.0.6
func (*Material) SetUnifFloat32 ¶
func (*Material) SetUnifInt32 ¶ added in v0.0.5
func (*Material) SetUniformBlockBindingPoint ¶ added in v0.28.0
type MaterialSettings ¶ added in v0.24.0
type MaterialSettings uint64
const ( MaterialSettings_None MaterialSettings = iota MaterialSettings_HasModelMtx MaterialSettings = 1 << (iota - 1) MaterialSettings_HasNormalMtx )
func (*MaterialSettings) Has ¶ added in v0.24.0
func (ms *MaterialSettings) Has(flags MaterialSettings) bool
func (*MaterialSettings) Remove ¶ added in v0.24.0
func (ms *MaterialSettings) Remove(flags MaterialSettings)
func (*MaterialSettings) Set ¶ added in v0.24.0
func (ms *MaterialSettings) Set(flags MaterialSettings)
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_Cubemap_Array TextureSlot = 11 TextureSlot_ShadowMap1 TextureSlot = 12 TextureSlot_ShadowMap_Array1 TextureSlot = 13 )
Click to show internal directories.
Click to hide internal directories.