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?
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 Hasn’t helped my specific problem (yet), but I may understand after a few more re-readings!
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?).