/
submesh.go
44 lines (39 loc) · 957 Bytes
/
submesh.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package internal
import (
"github.com/mokiat/gomath/sprec"
"github.com/mokiat/lacking/framework/opengl"
)
type SubMesh struct {
surface Surface
material *Material
vertexArray *opengl.VertexArray
transformMatrix sprec.Mat4
textureTransformMatrix sprec.Mat4
texture *opengl.TwoDTexture
color sprec.Vec4
vertexOffset int
vertexCount int
primitive uint32
culling bool
cullFace uint32
clipBounds sprec.Vec4
skipColor bool
stencil bool
stencilCfg stencilConfig
}
type stencilConfig struct {
stencilOpFront stencilOp
stencilOpBack stencilOp
stencilFuncFront stencilFunc
stencilFuncBack stencilFunc
}
type stencilOp struct {
sfail uint32
dpfail uint32
dppass uint32
}
type stencilFunc struct {
fn uint32
ref int32
mask uint32
}