PDA

View Full Version : pbuffer, render_texture and mipmaps



valoh
09-01-2004, 07:56 AM
Hi,

it's not quite clear to me if and how pbuffer, render_texture and GL_MIPMAP_GENERATE work together.

if I use for my textures GL_GENERATE_MIPMAP and a pbuffer with render_texture and WGL_MIPMAP_TEXTURE_ARB will there be the mipmaps generated if I bind the pbuffer to the texture with wglBindTexImageARB?

Currently it seems not to, in my application the mipmap is incorrect, some static other view of my scene, I guess its just some garbage which happens to be at the memory where the mipmap should be generated.

Is it possible to use GL_GENERATE_MIPMAP with ARB_render_texture? And if so, what could be wrong if the mipmap isn't correctly generated...

flamz
09-01-2004, 08:18 AM
the mipmaps should be generated when the texture is bound.

did you specify WGL_MIPMAP_TEXTURE_ARB as an attribute of your p-buffer and set GENERATE_MIPMAP_SGIS to true with glTexParameter ?

valoh
09-01-2004, 11:24 AM
Originally posted by flamz:
the mipmaps should be generated when the texture is bound.

did you specify WGL_MIPMAP_TEXTURE_ARB as an attribute of your p-buffer and set GENERATE_MIPMAP_SGIS to true with glTexParameter ?yes, that's axactly what I'm doing, but instead of GL_GENERATE_MIPMAP_SGIS I use GL_GENERATE_MIPMAP

valoh
09-03-2004, 04:40 AM
btw: I have found the problem, the mipmap was not garbage but the first frame which didn't got updated.

With a

glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 0, 0, 0);

before wglBindTexImageARB the mipmap is updated correctly (perhaps with an one frame lag, haven't tested it).
Is this supposed to be the correct workaround to get the mipmap updated?
I would have thought that this were implicitly done with wglBindTexImageARB, but obviously it's not...