Texture3D and volume renderin

142 views
Skip to first unread message

Irwin Zaid

unread,
Jun 29, 2014, 12:44:49 PM6/29/14
to vi...@googlegroups.com
Hi all,

I've been playing around with VisPy over the last few days, and it's been fun. So thanks for that.

What I'd like to do is implement volume rendering in VisPy. I saw the post from Jonathan on this topic, and following that, I'm trying to do it with 3D textures -- in particular, the way Cyrille suggested.

From what I understand, this means first modifying VisPy's codegen to generate code for texImage3D and the corresponding constant GL_TEXTURE_3D. I modified annotations.py, adding texImage3D analogous to texImage2D. I also modified gl2.h, adding a #define for GL_TEXTURE_3D and an entry for glTexImage3D in the "GL core functions" part. This seemed to generate the right code, but I when I try to use gl.glTexImage3D(...) I get the error:

--

TypeError: glTexImage3D() takes 0 positional arguments but 6 were given

--

What am I doing wrong here? I'd be happy to implement volume rendering if I can figure out what needs to be done.

Cheers,

Irwin

Almar Klein

unread,
Jun 30, 2014, 8:08:32 AM6/30/14
to vi...@googlegroups.com
Hi Irwin,

I think it should be easier to take the code in gloo/texture.py and
create a 3D texture from that. You should then probably use glTexImage3D
from pyopengl.

We are still looking how we can provide this functionality in a nice
way. But probably this does not include changing our codegen, but taking
the necessary functions from pyopengl.

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

Irwin Zaid

unread,
Jun 30, 2014, 9:00:12 AM6/30/14
to vi...@googlegroups.com
Hi Almar,

Thanks for the reply. Okay, I'll do away with the codegen modifications.

I already have a Texture3D class in gloo/texture.py similar to Texture2D, so I'm with you on that. I'm just trying to get at glTexImage3D.

Should I just be using it via PyOpenGL directly, like "from OpenGL.GL import glTexImage3D" or is it already imported through 'gl' or something else in textures.py?

Irwin

Almar Klein

unread,
Jun 30, 2014, 9:04:04 AM6/30/14
to vi...@googlegroups.com

> Should I just be using it via PyOpenGL directly, like "from OpenGL.GL
> import glTexImage3D" or is it already imported through 'gl' or something
> else in textures.py?

Eventually it may be in gloo.glplus, or maybe in gloo.gl after you have
done gloo.gl.use('gl3') or something similar. See
https://github.com/vispy/vispy/pull/185 for some work in progress.

But for now, I propose you import from pyOpenGL directly ...

- Almar
> > an email to vispy+un...@googlegroups.com <javascript:>
> > <mailto:vispy+un...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
Reply all
Reply to author
Forward
0 new messages