OpenGL version / Compute Shaders

35 views
Skip to first unread message

mib...@gmail.com

unread,
Aug 12, 2016, 8:49:30 AM8/12/16
to glumpy-users
Dear Developers

I learned to know about Glumpy due to an answer by Nicolas Rougier on the PyOpenGL mailing list. It seems to be exactly what I'm looking for: A lean library that makes OpenGL available and convenient to use in Python.

I'm now halfway through the documentation. Two questions came up so far. I'm pretty new to OpenGL and I think I don't have the full picture yet, so my question might seem a bit stupid.

1. I learned (better: got an idea of) OpenGL with the "OpenGL Programming Guide (2013)" for version 4.3. As far as I understand, Glumpy is based on another version. Which one is it? Can I use features I learned for 4.3 or should I go and get a book about an older version?

2. The book mentions "Compute Shaders" which would be very interesting for my application. Can I use them in combination with Glumpy?

Best regards and thanks in advance,
Michael

Nicolas Rougier

unread,
Aug 12, 2016, 8:53:03 AM8/12/16
to glumpy...@googlegroups.com

Hi Michael,


Glumpy tries to stick to GL 2.1 because it is compatible with GL ES 2.0 and WebGL. It's not too much work to go for 4.3 but you cannot do it straight away.

As for shaders, there are many type and currently glumpy only implements vertex, fragment and geometry. I don't use compute shader but this could made possible. What kind of computation do you intend to do ?


Nicolas
> --
> You received this message because you are subscribed to the Google Groups "glumpy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to glumpy-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

mib...@gmail.com

unread,
Aug 14, 2016, 6:19:50 AM8/14/16
to glumpy-users
Hi Nicolas

Regarding the compute shaders: I'd like to do some geometry stuff to help my pseudo-physics, for example test whether a point is inside a polygon or how far a point is away from the nearest polygon surface. Basically, I'd like to harness the GPU for as many and as general computations as possible. So I'd prefer to stay away from some nasty hacks.

I see that compute shaders were introduced in OpenGL 4.3 and transform feedback buffers (which might also be helpful) were in introduced in OpenGL 3.0. I don't know whether Glumpy can read back data from the GPU.

Michael

Nicolas Rougier

unread,
Aug 14, 2016, 9:55:58 AM8/14/16
to glumpy...@googlegroups.com

Yes, glumpy can read back from GPU through buffer (have a look at smoke simulation). For compute shaders, it might b not too hard to add them but I would need a simple example to check whether everything's right. Would you have a simple tutorial/example ?

Nicolas

mib...@gmail.com

unread,
Aug 15, 2016, 5:41:18 AM8/15/16
to glumpy-users
I had a short look into the compute-examples (smoke, game of life) but did not take the time to fully understand them. But sounds good with the buffer readback, so I'll have a very close look into the smoke example.

Regarding the compute shaders: I'll try to do create an example, yes. It will take some time since I'm in the very beginning of learning and understanding OpenGL, so I have to do some experimentation first...

Best regards and thanks a lot
Michael
Reply all
Reply to author
Forward
0 new messages