Poke word8 colors for shapes

This commit is contained in:
2023-04-13 02:30:23 +01:00
parent 5d4234a8f4
commit 3c43caee9c
6 changed files with 33 additions and 15 deletions
+7 -2
View File
@@ -67,12 +67,17 @@ preloadRender = do
-- setup shape geometry/cap VBO and two VAOs
putStrLn "Setup shape VBO, VAO, EBO"
shVBO <- setupVBO (floatSize * nShapeVerxComp)
shVBO <- setupVBO shapeVerxSize
shPosVAO <- setupVAOUsingVBO [VertexAttribute 4 GL_FLOAT GL_FALSE 0] shVBO
shEBO <- setupEBO shPosVAO
-- note the shape shader vao is distinct from the position vao, but they
-- share an EBO
shapeshader <- makeShaderUsingVBO "shape/basic" [vert, frag] (toFloatVAs shapeVerxSizes) pmTriangles shVBO
shapeshader <- makeShaderUsingVBO "shape/basic" [vert, frag]
[VertexAttribute 4 GL_FLOAT GL_FALSE 0
,VertexAttribute 4 GL_UNSIGNED_BYTE GL_TRUE (fromIntegral 4 * fromIntegral floatSize)
,VertexAttribute 4 GL_FLOAT GL_FALSE (fromIntegral 4 * fromIntegral (floatSize + ubyteSize))
]
pmTriangles shVBO
glVertexArrayElementBuffer (shapeshader ^. shaderVAO . vaoName) (shEBO ^. eboName)
--setup silhouette edge VAO