LWJGL Forum

Programming => OpenGL => Topic started by: rp on July 10, 2012, 15:44:50

Title: gluBuild3DMipmaps
Post by: rp on July 10, 2012, 15:44:50
Hello all,

I was looking for gluBuild3DMipmaps in the class GLU, but I can't find it. Is there another way to access this method?

Regards,
rp
Title: Re: gluBuild3DMipmaps
Post by: Fool Running on July 10, 2012, 17:02:58
Someone can correct me if I'm wrong, but it looks like LWJGL only supports GLU version 1.2 (gluBuild3DMipmaps is in version 1.3).
Title: Re: gluBuild3DMipmaps
Post by: rp on July 10, 2012, 20:34:42
Must be something like that. If anyone else has this question, it can be done, since openGL 1.4. You must call
glTexParameteri(GL_TEXTURE_3D, GL_GENERATE_MIPMAP, GL_TRUE);
before glTexImage3D(...)

Regards.
rp
Title: Re: gluBuild3DMipmaps
Post by: mattdesl on July 11, 2012, 12:06:17
You should use glGenerateMipmap instead, and only fall back to GL_GENERATE_MIPMAP if necessary.

http://www.opengl.org/wiki/Common_Mistakes#gluBuild2DMipmaps
http://www.g-truc.net/post-0256.html

Here's what I do:
- If GL30 is supported, use GL30.glGenerateMipmap()
- Otherwise, if GL_EXT_framebuffer_object is present, use EXTFramebufferObject.glGenerateMipmapEXT()
- Otherwise, fall back to GL_GENERATE_MIPMAP
Title: Re: gluBuild3DMipmaps
Post by: rp on July 11, 2012, 13:17:20
Thanks for this Update. I just found the solution somewhere in the web. But yours seems to be better.

Thanks.