Sign in to follow this  
CDProp

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

Recommended Posts

CDProp    1451

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?

Edited by CDProp

Share this post


Link to post
Share on other sites
bubu LV    1436

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.

Share this post


Link to post
Share on other sites
CDProp    1451

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?

Share this post


Link to post
Share on other sites
CDProp    1451

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 =)

Edited by CDProp

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this