Commit before adding normals to shapes

This commit is contained in:
2023-03-14 22:34:29 +00:00
parent db0d24d044
commit cfddd1515f
2 changed files with 2 additions and 18 deletions
+2 -17
View File
@@ -90,26 +90,13 @@ preloadRender = do
GL_STREAM_DRAW
let shEBO = EBO{_eboName = shEBOname, _eboPtr = shEBOptr}
shVBO <- setupVBO4 8
-- shPosColVAOname <- mglCreate glCreateVertexArrays
-- glBindVertexArray shPosColVAOname
-- setupVertexAttribPointer shPosColVAOname (shVBO ^. vboName) 0 3 7 0
-- setupVertexAttribPointer shPosColVAOname (shVBO ^. vboName) 1 4 7 3
-- --bindBuffer ElementArrayBuffer $= Just shEBOname
-- glVertexArrayElementBuffer shPosColVAOname shEBOname
--shPosVAOname <- genObjectName
--bindVertexArrayObject $= Just shPosVAOname
shPosVAOname <- mglCreate glCreateVertexArrays
glBindVertexArray shPosVAOname
glVertexArrayVertexBuffer shPosVAOname 0 (shVBO ^. vboName) 0 (fromIntegral $ floatSize * 8)
setupVertexAttribPointer shPosVAOname 0 4 0
--bindBuffer ElementArrayBuffer $= Just shEBOname
glVertexArrayElementBuffer shPosVAOname shEBOname
let --shPosColVAO = VAO
-- {_vaoName = shPosColVAOname, _vaoAttribSizes = [3,4], _vaoStride = 7}
shPosVAO = VAO{_vaoName = shPosVAOname, _vaoAttribSizes = [3], _vaoStride = 7}
let shPosVAO = VAO{_vaoName = shPosVAOname, _vaoAttribSizes = [4], _vaoStride = 8}
--setup silhouette edge VAO
--shEdgeVAOname <- genObjectName
--bindVertexArrayObject $= Just shEdgeVAOname
shEdgeVAOname <- mglCreate glCreateVertexArrays
glBindVertexArray shEdgeVAOname
glVertexArrayVertexBuffer shEdgeVAOname 0 (shVBO ^. vboName) 0 (fromIntegral $ floatSize * 8)
@@ -117,16 +104,14 @@ preloadRender = do
--setup ebo for silhouette edges
silEBOname <- mglCreate glCreateBuffers
silEBOptr <- mallocArray numDrawableElements
-- it may be important to bind this while the correct VAO is bound
glVertexArrayElementBuffer shEdgeVAOname silEBOname
--bindBuffer ElementArrayBuffer $= Just silEBOname
glNamedBufferData
silEBOname
( fromIntegral $ glushortSize * numDrawableElements)
nullPtr
GL_STREAM_DRAW
let silEBO = EBO{_eboName = silEBOname, _eboPtr = silEBOptr}
shEdgeVAO = VAO{_vaoName = shEdgeVAOname, _vaoAttribSizes = [3], _vaoStride = 7}
shEdgeVAO = VAO{_vaoName = shEdgeVAOname, _vaoAttribSizes = [4], _vaoStride = 8}
-- shEdgeVAO is unecessary?
-- lighting shaders
lightingWallShadShad <-
-1
View File
@@ -50,7 +50,6 @@ data VAO = VAO
{ _vaoName :: GLuint
, _vaoAttribSizes :: [Int] -- ^ It is not clear to me if this is necessary to store or not
, _vaoStride :: Int
-- , _vaoVBO :: VBO
}
{- | Vertex buffer object: contains the reference to the object,
a pointer to a location with space that can be written to the buffer,