<p>Layered rendering requires array textures, period (well, cubemaps can also work, but they're basically array textures anyway). There's no avoiding that.</p>
<p>But unless you need the sizes and formats of the individual &quot;layers&quot; to be different, there's no reason you should be unable to use array textures for this purpose.</p>

CC BY-SA 4.0
2022-03-02T15:08:14.503Z
2022-03-02T15:08:14.503Z
Nicol Bolas
<p>I have a scenario with several cameras. Each hold its own color and depth texture.
Because the geometry of the environment is expansively procedural generated, I would like to combine cameras with same resolution and texture format, to use layered rendering. This would be a very good performance boost.</p>
<p>The question: Is it possible to combine multiple textures within a Framebuffer, so that when using layered rendering, each camera texture is a separate layer?
I know, that when combining all camera textures to one single GL_TEXTURE_2D_ARRAY texture, I could use layered rendering. But I would like to manage them separately, because from time to time the camera positions move away from each other, so the layered rendering will not be helpful anymore. Or better several groups of cameras, which are nearby should be flexible grouped to one layered rendering call.</p>

CC BY-SA 4.0
2022-03-02T15:06:42.700Z
"*But I would like to manage them separately, because from time to time the camera positions move away from each other, so the layered rendering will not be helpful anymore.*" Why not? The actual vertex data you use for a particular layer isn't about the way the layers are stored in the texture.
Nicol Bolas
<opengl><frame-buffer>
Combining multiple textures within Framebuffer to use them in layered rendering
Thomas
# Combining multiple textures within Framebuffer to use them in layered rendering

(Asked by: username_0 on 2022-03-02)

I have a scenario with several cameras. Each hold its own color and depth texture.
Because the geometry of the environment is expansively procedural generated, I would like to combine cameras with same resolution and texture format, to use layered rendering. This would be a very good performance boost.

The question: Is it possible to combine multiple textures within a Framebuffer, so that when using layered rendering, each camera texture is a separate layer?
I know, that when combining all camera textures to one single GL\_TEXTURE\_2D\_ARRAY texture, I could use layered rendering. But I would like to manage them separately, because from time to time the camera positions move away from each other, so the layered rendering will not be helpful anymore. Or better several groups of cameras, which are nearby should be flexible grouped to one layered rendering call.

**Tags:** opengl, frame-buffer

> **Comments:**
> **username_1**: "*But I would like to manage them separately, because from time to time the camera positions move away from each other, so the layered rendering will not be helpful anymore.*" Why not? The actual vertex data you use for a particular layer isn't about the way the layers are stored in the texture.  

---

## 1 answers

### Answer by username_1 on 2022-03-02. Score: 1 | Accepted answer

Layered rendering requires array textures, period (well, cubemaps can also work, but they're basically array textures anyway). There's no avoiding that.

But unless you need the sizes and formats of the individual "layers" to be different, there's no reason you should be unable to use array textures for this purpose.


---

