haskell-opengl / OpenGL

Haskell bindings to OpenGL
http://www.haskell.org/haskellwiki/OpenGL
BSD 3-Clause "New" or "Revised" License
147 stars 26 forks source link

Missing support for double precision vertex attributes #94

Open simeonkr opened 1 year ago

simeonkr commented 1 year ago

According to https://registry.khronos.org/OpenGL-Refpages/gl4/html/glVertexAttribPointer.xhtml, vertex attributes that have a double precision type (double, dvec2, etc.) must be specified using glVertexAttribLPointer. However, the internal setVertexAttribPointer makes use of only glVertexAttribPointer and glVertexAttribIPointer, which means that precision will be lost even if the VertexArrayDescriptor argument specifies a Double type. In fact, I found that redefining vertex attributes to be double precision (making sure to pass in the correct type to vertexAttribPointer) makes otherwise functioning code result in black screens.