PBuffers and Mipmaps

Hi guys.

I’ve just gotten started with PBuffers, and after a bit of work I’m able to render a scene into a texture successfully. However, I am at a loss as to how I’d generate mipmaps for it, which should be updated every frame (since the scene is changing every frame). From my searching, Apple’s PBuffer documentation seems extremely minimal, and I can’t seem to find any examples for how to generate mipmaps for PBuffers. If possible, could someone list all the steps necessary to do this successfully?

Thanks very much for any help,
CobraMantis

You can do it manually, by texturing from one level of the pbuffer to the next one down (or up depending on your perspective :wink: ),

or, rather than using TexImagePBuffer, you can share contexts, and use glCopyTexImage2D with GENERATE_MIPMAP_SGIS enabled.

If that’s not enough, post again and I’ll see if I can dig up code…

Aha! That did the trick — thanks a million, OneSadCookie!

I’m having very similar problems with figuring out mipmaps and pbuffers: could either of you post some short working example code?

…also, I’ve been pestering the mac-opengl list for the last few days, and geoff stahl finally came thru with a wee bit of preliminary documentation today :wink: Hasn’t helped my specific problem (yet), but I may understand after a few more re-readings!

thanx

The major things are as follows:

When setting the texture parameters for the pbuffer texture (probably just when you create it), use glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE). When you want to update your mipmaps, bind your pbuffer texture and use the aglTexImagePBuffer() function (if you’re using multiple contexts it may require a context switch?).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.