MCPcopy
hub / github.com/g3n/engine / Material

Struct Material

material/material.go:62–94  ·  view source on GitHub ↗

Material is the base material.

Source from the content-addressed store, hash-verified

60
61// Material is the base material.
62type Material struct {
63 refcount int // Current number of references
64
65 // Shader specification
66 shader string // Shader name
67 shaderUnique bool // shader has only one instance (does not depend on lights or textures)
68 ShaderDefines gls.ShaderDefines // shader defines
69
70 side Side // Face side(s) visibility
71 blending Blending // Blending mode
72 useLights UseLights // Which light types to consider
73 transparent bool // Whether at all transparent
74 wireframe bool // Whether to render only the wireframe
75 lineWidth float32 // Line width for lines and wireframe
76 textures []*texture.Texture2D // List of textures
77
78 polyOffsetFactor float32 // polygon offset factor
79 polyOffsetUnits float32 // polygon offset units
80
81 depthMask bool // Enable writing into the depth buffer
82 depthTest bool // Enable depth buffer test
83 depthFunc uint32 // Active depth test function
84
85 // TODO stencil properties
86
87 // Equations used for custom blending (when blending=BlendCustom) // TODO implement methods
88 blendRGB uint32 // separate blending equation for RGB
89 blendAlpha uint32 // separate blending equation for Alpha
90 blendSrcRGB uint32 // separate blending func source RGB
91 blendDstRGB uint32 // separate blending func dest RGB
92 blendSrcAlpha uint32 // separate blending func source Alpha
93 blendDstAlpha uint32 // separate blending func dest Alpha
94}
95
96// NewMaterial creates and returns a pointer to a new Material.
97func NewMaterial() *Material {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected