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