How to send matrices to GLSL uniform variables

Hi everyone, In OpenGL 3.2, there is no fixed pipeline functionalities. So I would like to send my model-view-projection matrix to GLSL through an uniform variable. But I seem that there is no glUniformMatrix* family in HOpenGL. (http://hackage.haskell.org/packages/archive/OpenGL/2.5.0.0/doc/html/Graphics...) How can I achieve this?

On Thu, Aug 23, 2012 at 9:32 AM, 梶本 裕介
Hi everyone,
In OpenGL 3.2, there is no fixed pipeline functionalities. So I would like to send my model-view-projection matrix to GLSL through an uniform variable. But I seem that there is no glUniformMatrix* family in HOpenGL.
In general, if you can't find it in HOpenGL, look at OpenGLRaw: http://hackage.haskell.org/package/OpenGLRaw (
http://hackage.haskell.org/packages/archive/OpenGL/2.5.0.0/doc/html/Graphics... ) How can I achieve this?
I don't have an example handy, but I believe this is possible. Perhaps someone else will have an example. Jason

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...

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
On Fri, Aug 24, 2012 at 9:31 AM, Yusuke Kajimoto
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@haskell.org http://www.haskell.org/mailman/listinfo/hopengl

On Fri, Aug 24, 2012 at 6:56 PM, Myles C. Maxfield
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
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@haskell.org http://www.haskell.org/mailman/listinfo/hopengl
_______________________________________________ HOpenGL mailing list HOpenGL@haskell.org http://www.haskell.org/mailman/listinfo/hopengl

On Fri, Aug 24, 2012 at 11:40 PM, L Corbijn
On Fri, Aug 24, 2012 at 6:56 PM, Myles C. Maxfield
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
Merged. The reminder helped, otherwise I would have continued to forget about it. Jason
participants (5)
-
Jason Dagit
-
L Corbijn
-
Myles C. Maxfield
-
Yusuke Kajimoto
-
梶本 裕介