View Full Version : Layered Rendering - Set layer attachments individually

Admiral Habor
12-28-2015, 07:17 AM
I'd like to know whether it is possible to set the color/depth attachment points with texture layers individually for each render layer.

glFramebufferTextureLayer - Is not usable, since the "layer" parameter attributes the layer of the texture you want to use for your attachment point (on render layer 0 I guess).
glFramebufferTexture - Is a bit nicer, but either assigns all Cube Map/Texture Array layers to all render layer attachment points in a logical way or does the same as glFramebufferTextureLayer.

Alfonse Reinheart
12-28-2015, 08:19 AM
There are no "render layer attachment points". There are only attachment points, and the image attached can be either layered or not layered (https://www.opengl.org/wiki/Framebuffer_Object#Semantics). So two textures cannot provide images for two layers in an attachment point.

There is also no single call to attach a subset of layers from a layered image to an FBO. However, by employing texture views (https://www.opengl.org/wiki/View_Texture), you can get the same effect. Just create a view of the texture that only includes the range of layers you want to use.

Admiral Habor
12-28-2015, 12:11 PM
Ok, thank you. That cleans up a lot of possible questions.