PDA

View Full Version : how to get gluBuild3DMipmaps



HollanErno
04-03-2008, 06:12 AM
Hello to all,
I am trying to find out how to get the function gluBuild3DMipmaps. I tried using glew but the linker says that despite is defined the function is not present. Tried also with SDL_GL_GetProcAddress and it seems that the function is not there either. I know that gluBuild3DMipmaps is included int GLU 1.3 but the question is, how do I get GLU 1.3? do I really have to grab SGI's implementation and compile it on my own?

Thanks

-NiCo-
04-03-2008, 07:01 AM
GLU is a GL helper utility, not a GL extension. So the function calls will not be exposed through glew. Did you link your app to the GLU library? It's probably something like glu.dll or glu32.dll in windows.

HollanErno
04-03-2008, 07:05 AM
Yes, I am linking to GLU32 (winxp sp2 VS8) infact I use gluBuild2DMipmaps (note the "2D") all the time, but if I try to use gluBuild3DMipmaps I get the above mentioned link error.
Did anyone managed to use gluBuild3DMipmaps?

Just checked my GLU_VERSION and is "1.2.2.0 Microsoft Corporation", so the question remains, how do we get GLU 1.3 under windows?

-NiCo-
04-03-2008, 07:14 AM
here (http://www.geocities.com/vmelkon/glu.html)

HollanErno
04-03-2008, 07:30 AM
Mh, so it seems that one has to compile his own version from SGI, is this the "official" way to do?

On the very same page there is an interesting line:

"Also, gluBuild3DMipmaps and gluBuild3DMipmapLevels has been fixed so that it gets the addresses it needs using wglGetProcAddress"

sounds stragne to me too though...

-NiCo-
04-03-2008, 07:39 AM
Don't know what the official way is, I'm using linux (ubuntu) an it apparently I already have glu version 1.3.

PS. The mesa (http://www.mesa3d.org/) gl implementation also has glu code. Don't know if it's 1.3 though.

V-man
04-03-2008, 09:44 AM
Mh, so it seems that one has to compile his own version from SGI, is this the "official" way to do?

On the very same page there is an interesting line:

"Also, gluBuild3DMipmaps and gluBuild3DMipmapLevels has been fixed so that it gets the addresses it needs using wglGetProcAddress"

sounds stragne to me too though...

That's because gluBuild3DMipmaps calls glTexImage3D and glTexImage3D is not exported from opengl32.dll
In order to use it, it is necessary to get the function pointer from the driver itself by calling

glTexImage3D = wglGetProcAddress("glTexImage3D");

But I have a better idea. Since we are in 2008, let the hw do the mipmapping for you.
Just stick a glTexParameteri(GL_TEXTURE_3D, GL_GENERATE_MIPMAP, TRUE) for each 3D texture you make.

Nicolai de Haan Brøgger
04-03-2008, 10:06 AM
let the hw do the mipmapping for you.

You mean the driver, right? I thought the construction of the mipmap chain is still not hardware-accelerated.

Seth Hoffert
04-03-2008, 10:19 AM
glGenerateMipmapEXT is often hardware accelerated.

Zengar
04-03-2008, 10:50 AM
Hardware accelerated mip-map construction was there for years. Actually, any card that can render to texture should be able to do it.

HollanErno
04-03-2008, 02:15 PM
But I have a better idea. Since we are in 2008, let the hw do the mipmapping for you.
Just stick a glTexParameteri(GL_TEXTURE_3D, GL_GENERATE_MIPMAP, TRUE) for each 3D texture you make.

Actually, yes, since GL_GENERATE_MIPMAP is there since OGL 1.4 it seems also to me reasonable enough to rely on it, especially if one expects the same application to use 3D textures.

Thanks