diff --git a/src/Preload/Render.hs b/src/Preload/Render.hs index 161dde956..e74eb6111 100644 --- a/src/Preload/Render.hs +++ b/src/Preload/Render.hs @@ -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 <- diff --git a/src/Shader/Data.hs b/src/Shader/Data.hs index 6022a6eb4..af1311898 100644 --- a/src/Shader/Data.hs +++ b/src/Shader/Data.hs @@ -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,