Sign in to follow this  
bene81

Automatic MipMap creation [Solved]

Recommended Posts

Hello, since fbo do not work (till now, see my other thread), I render to back buffer and use glCopyTexSubImage2D. Is it possible to auto generate the mip maps ? What would be the right way to do this? I only found stuff which describe mip map generation if the texture is loaded from an image. Thank you! [Edited by - bene81 on October 10, 2007 5:27:43 AM]

Share this post


Link to post
Share on other sites

Hello. Have you looked at section 3.8.8 in the OpenGL specification 2.1 (p. 178)? The specification is a great source for information smile.png

It can be done glTexParameter with the parameter name set to GL_GENERATE_MIPMAP and a value of GL_TRUE. It is just the old extension http://www.opengl.org/registry/specs/SGIS/generate_mipmap.txt that has been promoted to the core.

kind regards,
Nicolai

Edited by ndhb

Share this post


Link to post
Share on other sites
Thanks,

the Gl is doing some stuff (framerate drops), but the texture is not
shown anymore.

I set min/mag filter to linearmiplinear

Share this post


Link to post
Share on other sites
Quote:
Original post by bene81
I set min/mag filter to linearmiplinear

Try GL_LINEAR for the mag filter; GL_LINEAR_MIPMAP_LINEAR isn't an acceptable magnifying filter.

(Source: Bottom of MSDN's page, which has lots of other useful information.)

Hope that helps!
-jouley

Share this post


Link to post
Share on other sites
Sounds like a job for glGetError! Sprinkle liberally about the offending code, and let us know exactly what breaks. Or, if everything seems okay, show us the code and we'll go from there.

Share this post


Link to post
Share on other sites
Yes I did this. No error. (Cube Map texture bound, SetParameter to Cubemap-Target)
Min - LinearMipLinear, Mag - Linear

With FBOs glGenerateMipMapEXT rises Invalid Operation (stupid),
here target is each cubemap side, whereas SetParameter git the global target.

Any hints ?
I will post code tomorrow.



Share this post


Link to post
Share on other sites
From the FBO Specs...
Quote:
Mipmaps can be generated manually with the command
       void GenerateMipmapEXT(enum target);
where <target> is one of TEXTURE_1D, TEXTURE_2D, TEXTURE_CUBE_MAP, or TEXTURE_3D. Mipmap generation affects the texture image attached to <target>. For cube map textures, INVALID_OPERATION is generated if the texture bound to <target> is not cube complete, as defined in section 3.8.10.
Is your cube map texture cube complete? I'm also not sure what you mean here...
Quote:
Originally posted by bene81
With FBOs glGenerateMipMapEXT rises Invalid Operation (stupid),
here target is each cubemap side, whereas SetParameter git the global target.
You don't mean you call glGenerateMipmapEXT with target set to each of the six GL_TEXTURE_CUBE_MAP_*_* faces, right? It only accepts GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, or GL_TEXTURE_3D.

Share this post


Link to post
Share on other sites
Autogeneration works. Thanks for your help.

Unfortenutally it significantly drops my framerate. And the result is not as expected, I will stay by simple linear filter.

Thank for all your help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this