PDA

View Full Version : SGIS_generate_mipmap and cubemaps



Won
03-07-2001, 12:07 AM
The specification for sgis_gen_mmaps explicitly states that it only works for n-dimensional textures. I checked the cube-map spec, but it doesn't really even mention sgis-g-m.

It would be nice to enable sgis_gen_mmap on a cube-map used as a procedurally-generated environment map. Maybe it could be enabled per-face or something, and each face gets automatic mipmap generation independently.

Also, is sgis_gen_mmaps faster than gluBuildMipmaps? If the texture format/size is already set and allocated, then I would imagine so. Is it fast enough to use per-frame?

--Won

cass
03-07-2001, 05:07 AM
Won,

Yes, SGIS_generate_mipmap works for cube maps! It is great for dynamically generated cubemaps - and the cost is roughly 50% more than the cost of updating only the base level image (via glCopyTexSubImage2D()).

SGIS_generate_mipmap beat gluBuild2DMipmaps() in all the tests I saw -- even when it's implemented in software. Of course it wins by a much larger margin when it's hardware accelerated.

Check out the demo simple_shared_pbuffer for an example program that renders a teapot into a 512x512 pbuffer, uses glCopyTexSubImage2D() for a hardware accelerated copy to an SGIS_generate_mipmap-enabled texture. The texture is then applied to a quad in the on-screen window with trilinear, anisotropic filtering.
This should give you a good feel for what you can do real-time.

Thanks -
Cass