Jump to content

  • Log In with Google      Sign In   
  • Create Account


glGenerateMipMap ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 ChaseRLewis   Members   -  Reputation: 140

Like
0Likes
Like

Posted 20 February 2011 - 03:04 PM

So coming from DirectX trying to teach myself OpenGL. I"m using the SuperBible 5th edition book and up till texturing it's been doing fine. However, I'm noticing a few functions they use in this chapter don't see to be in any of the libraries I downloaded.

It mentions a glGenerateMipMap(GLenum enum) that don't exist in any OpenGL library I've tried.

So basically how should I go about generating mipmaps? gluBuild2DMipMap?

Sponsor:

#2 karwosts   Members   -  Reputation: 836

Like
0Likes
Like

Posted 20 February 2011 - 03:09 PM

Maybe you mean glGenerateMipmap? (lowercase m)

http://www.opengl.org/sdk/docs/man3/xhtml/glGenerateMipmap.xml

I believe this function has replaced gluBuild (I think it's faster and leverages the GPU in some way, glu was just a utility function that probably did everything locally on the cpu). I'm purely guessing though.
My Projects:
Portfolio Map for Android - Free Visual Portfolio Tracker
Electron Flux for Android - Free Puzzle/Logic Game

#3 Erik Rufelt   Crossbones+   -  Reputation: 3378

Like
0Likes
Like

Posted 20 February 2011 - 03:15 PM

Also, that function won't be in the library, but must be dynamically loaded (using wglGetProcAddress on Windows), as must all other newer OpenGL functionality. You can use a library such as for example GLEW to make this easier.

#4 ChaseRLewis   Members   -  Reputation: 140

Like
0Likes
Like

Posted 20 February 2011 - 04:01 PM

Also, that function won't be in the library, but must be dynamically loaded (using wglGetProcAddress on Windows), as must all other newer OpenGL functionality. You can use a library such as for example GLEW to make this easier.


Ya i've been using GLEW,the book hasn't mentioned anything about dynamically loading specific functions. Probably a fairly basic question, but how do I go about loading that function?

#5 mhagain   Crossbones+   -  Reputation: 7832

Like
0Likes
Like

Posted 20 February 2011 - 05:35 PM

If you're using GLEW you don't need to dynamically load it - it should already be available. That's the whole point of GLEW. Can you check that you called glewInit after initializing your context?

(As an aside, I personally prefer generating mipmaps by hand as I find that a simple box filter gives the best results for them, whereas with any autogen method you don't really have control over the filter type being used.)

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#6 dpoon   Members   -  Reputation: 174

Like
0Likes
Like

Posted 21 February 2011 - 02:57 AM

So coming from DirectX trying to teach myself OpenGL. I"m using the SuperBible 5th edition book and up till texturing it's been doing fine. However, I'm noticing a few functions they use in this chapter don't see to be in any of the libraries I downloaded.

It mentions a glGenerateMipMap(GLenum enum) that don't exist in any OpenGL library I've tried.

So basically how should I go about generating mipmaps? gluBuild2DMipMap?


The glGenerateMipmap() function was originally introduced in the GL_EXT_framebuffer_object extension. glGenerateMipmap() has been part of the core API since OpenGL 3.0.

In your learning you might see some sources telling you to use the GL_GENERATE_MIPMAP flag to the glTexParameteri() function to generate your mipmaps. Don't do that because that's been deprecated since OpenGL 3.0.



#7 V-man   Members   -  Reputation: 805

Like
0Likes
Like

Posted 21 February 2011 - 07:19 AM

All the info is here
http://www.opengl.org/wiki/Common_Mistakes#Automatic_mipmap_generation
http://www.opengl.org/wiki/Common_Mistakes#gluBuild2DMipmaps

and if you are new
http://www.opengl.org/wiki/Getting_started
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS