Automatic MipMap creation [Solved]

Started by
7 comments, last by bene81 16 years, 6 months ago
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]
Advertisement

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

Thanks,

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

I set min/mag filter to linearmiplinear
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
Does not work either
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.
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.



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.
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

This topic is closed to new replies.

Advertisement