Documentation ¶
Overview ¶
Package material contains several types of materials which can be used to set the appearance of graphic object
Index ¶
- type Basic
- type Blending
- type IMaterial
- type Material
- func (mat *Material) AddTexture(tex *texture.Texture2D)
- func (mat *Material) Dispose()
- func (mat *Material) GetMaterial() *Material
- func (mat *Material) HasTexture(tex *texture.Texture2D) bool
- func (mat *Material) Incref() *Material
- func (mat *Material) Init() *Material
- func (mat *Material) RemoveTexture(tex *texture.Texture2D)
- func (mat *Material) RenderSetup(gs *gls.GLS)
- func (mat *Material) SetBlending(blending Blending)
- func (mat *Material) SetDepthMask(state bool)
- func (mat *Material) SetDepthTest(state bool)
- func (mat *Material) SetLineWidth(width float32)
- func (mat *Material) SetPolygonOffset(factor, units float32)
- func (mat *Material) SetShader(sname string)
- func (mat *Material) SetSide(side Side)
- func (mat *Material) SetUseLights(lights UseLights)
- func (mat *Material) SetWireframe(state bool)
- func (mat *Material) Shader() string
- func (mat *Material) Side() Side
- func (mat *Material) TextureCount() int
- func (mat *Material) UseLights() UseLights
- type Phong
- type Point
- type Side
- type Standard
- func (ms *Standard) AmbientColor() math32.Color
- func (ms *Standard) EmissiveColor() math32.Color
- func (ms *Standard) Init(shader string, color *math32.Color)
- func (ms *Standard) RenderSetup(gs *gls.GLS)
- func (ms *Standard) SetAmbientColor(color *math32.Color)
- func (ms *Standard) SetColor(color *math32.Color)
- func (ms *Standard) SetEmissiveColor(color *math32.Color)
- func (ms *Standard) SetOpacity(opacity float32)
- func (ms *Standard) SetShininess(shininess float32)
- func (ms *Standard) SetSpecularColor(color *math32.Color)
- type UseLights
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Material ¶
type Material struct {
// contains filtered or unexported fields
}
Base Material
func (*Material) AddTexture ¶
AddTexture adds the specified Texture2d to the material
func (*Material) Dispose ¶
func (mat *Material) Dispose()
Dispose decrements this material reference count and if necessary releases OpenGL resources, C memory and textures associated with this material.
func (*Material) GetMaterial ¶
GetMaterial satisfies the IMaterial interface
func (*Material) HasTexture ¶
HasTexture checks if the material contains the specified texture
func (*Material) Incref ¶
Incref increments the reference count for this material and returns a pointer to the material. It should be used when this material is shared by another Graphic object.
func (*Material) RemoveTexture ¶
RemoveTexture removes the specified Texture2d from the material
func (*Material) RenderSetup ¶
func (*Material) SetBlending ¶
func (*Material) SetDepthMask ¶
func (*Material) SetDepthTest ¶
func (*Material) SetLineWidth ¶
func (*Material) SetPolygonOffset ¶
func (*Material) SetUseLights ¶
SetUseLights sets the material use lights bit mask specifying which light types will be used when rendering the material
func (*Material) SetWireframe ¶
func (*Material) TextureCount ¶
TextureCount returns the current number of textures
type Point ¶
type Point struct { Material // Embedded base material // contains filtered or unexported fields }
func (*Point) EmissiveColor ¶
EmissiveColor returns the material current emissive color
func (*Point) RenderSetup ¶
func (*Point) SetEmissiveColor ¶
SetEmissiveColor sets the material emissive color The default is {0,0,0}
func (*Point) SetOpacity ¶
func (*Point) SetRotationZ ¶
type Standard ¶
type Standard struct { Material // Embedded material // contains filtered or unexported fields }
func NewStandard ¶
NewStandard creates and returns a pointer to a new standard material
func (*Standard) AmbientColor ¶
AmbientColor returns the material ambient color reflectivity.
func (*Standard) EmissiveColor ¶
EmissiveColor returns the material current emissive color
func (*Standard) RenderSetup ¶
func (*Standard) SetAmbientColor ¶
SetAmbientColor sets the material ambient color reflectivity. The default is the same as the diffuse color
func (*Standard) SetColor ¶
SetColor sets the material diffuse color and also the material ambient color reflectivity
func (*Standard) SetEmissiveColor ¶
SetEmissiveColor sets the material emissive color The default is {0,0,0}
func (*Standard) SetOpacity ¶
SetOpacity sets the material opacity (alpha). Default is 1.0.
func (*Standard) SetShininess ¶
SetShininess sets the specular highlight factor. Default is 30.
func (*Standard) SetSpecularColor ¶
SetSpecularColor sets the material specular color reflectivity. The default is {0.5, 0.5, 0.5}