[HOpenGL] How to send matrices to GLSL uniform variables

L Corbijn aspergesoepje at gmail.com
Sat Aug 25 08:40:10 CEST 2012


On Fri, Aug 24, 2012 at 6:56 PM, Myles C. Maxfield
<myles.maxfield at gmail.com> wrote:
> According to http://hackage.haskell.org/package/OpenGL, it claims to support
> version 3.2, so a lack of glUniformMatrix seems like a huge oversight. This
> makes me think that one of two things is the case:
>
> 1. There is a way to do it, but it's non-obvious. Hopefully documentation
> could fix this.
> 2. There isn't a way to do it, so either
>   a. the OpenGL package shouldn't claim to be 3.2 compliant, or
>   b. the functionality should be added ;-)
>
> Does anyone know which case the current package falls into? And/or what can
> be done about making sure no one else in the future has the same problem
> that Yusuke has? I'd be willing to help out, but I don't know where to
> start.
>
> Thanks,
> Myles

It's point 2. The cabal package claims 3.2 compliance, though it's at
most 2.1 compliant (HOpenGLRaw is 3.2 compliant). I've written code
for 3.0 compliance (see github [pull request]), but that doens't
include it either yet. It should be incorporated in the Uniform
typeclass (see Shaders.hs or Sharders/Uniform.hs), but there should be
a extra typeclass for matrices or it should be added to the tensor
package.

Lars

[pull request] https://github.com/haskell-opengl/OpenGL/pull/27

>
> On Fri, Aug 24, 2012 at 9:31 AM, Yusuke Kajimoto <usk at lunaticengine.org>
> wrote:
>>
>>
>> > In general, if you can't find it in HOpenGL, look at OpenGLRaw:
>> > http://hackage.haskell.org/package/OpenGLRaw
>>
>> Thank you for your reply.
>> I achieved my aim using OpenGLRaw just now!
>>
>> But as there are no methods to access UniformLocation, AttribLocation,
>> VertexShader, FragmentShader and Program type internals, I rewrote almost
>> all of code around GLSL with OpenGLRaw...
>> _______________________________________________
>> HOpenGL mailing list
>> HOpenGL at haskell.org
>> http://www.haskell.org/mailman/listinfo/hopengl
>
>
>
> _______________________________________________
> HOpenGL mailing list
> HOpenGL at haskell.org
> http://www.haskell.org/mailman/listinfo/hopengl
>



More information about the HOpenGL mailing list