What can glFramebufferTexture1D/2D/3D do that glFramebufferTextureLayer can't?

Started by
4 comments, last by CDProp 11 years, 3 months ago

It seems that glFramebufferTexture and glFramebufferTextureLayer have all of the parameters needed to specify the exact image needed in any kind of texture, including cube map arrays (using the layer-face index). Am I missing something?

Advertisement

glFramebufferTextureLayer should be used with 1D/2D array textures to attach only one layer to framebuffer. I'm not sure, but I think the regular glFramebufferTexture1D/2D will fail if you'll use it with 1D/2D texture array.

Yeah. So it seems like glFramebufferTexture and glFramebufferTextureLayer can do everything that the 1D/2D/3D versions can do, and more.

If I want to attach a single-layered texture, or use layered rendering, I can use glFramebufferTexture.

If I want to attach to a single layer of a cube map, (1D/2D/Cube) array texture, or 3D texture, I can use glFramebufferTextureLayer.

So when do I ever need the 1D/2D/3D functions?

If you're using OpenGL version < 3.2.

Bingo, got it. Thanks!

Hmmmmm, I'm still a little unclear as to how to properly point to a cube map image using the glFramebufferTexture and glFramebufferTextureLayer functions. This may be an area where we still need the 2D version. It seems that, with glFramebufferTexture2D, one would use the textarget parameter to specify which face to use.

Perhaps glFramebufferTexture3D can be used to specify a layer in a cube map array texture? I sort of doubt it, though, because the documentation says that GL_TEXTURE_3D is the only valid textarget for glFramebufferTexture3D.

I know that glFramebufferTexture can be used along with a cube map to set up layered rendering, but I am not sure how to use glFramebufferTextureLayer to point to a specific layer-face of a cube map (or indeed if this is even possible).

This seems to be one of the more confusing sets of APIs within the OpenGL universe. =P =)

This topic is closed to new replies.

Advertisement