<p>You might look into &quot;mulitview&quot; it is fairly straight forward to setup and use. It does have limits on the number of views that can be rendered at the same time. Most examples are geared toward VR but it has obvious uses for a wide range of other situations like rendering cube maps. This would still mean multiple render passes but could get the number well under a hundred.  It is supported on both Vulkan and OpenGL.</p>

CC BY-SA 4.0
2022-07-01T19:50:39.707Z
2022-07-01T19:50:39.707Z
pmw1234
<p>Currently I have a basic (OpenGL 3.3) rendering scheme using a simple depth vertex shader to generate shadow maps for a scene. I don't care about having a large number of lights in the scene so it is fine to do individual render passes to generate each shadow map.</p>
<p><strong>What I want to do:</strong></p>
<p>My concern is that I want (or indeed NEED) to render the same scene geometry from many different camera transforms (over 500x) and it is very resource intensive to do one render pass per transform. Besides, reading pixels from the device is slow, so I would rather prefer to draw and fetch as many of these camera renders per call as the hardware allows. The current rendering pass uses a standard Phong vertex-&gt;fragment pipeline that relies on the computed shadow maps.</p>
<p><strong>What have I found:</strong></p>
<p>Despite all the parallel computing capabilities of GPU devices, I find the OpenGL API regarding shader pipelines somewhat abstruse. I found something called <a href="https://learnopengl.com/Advanced-OpenGL/Instancing" rel="nofollow noreferrer">instanced rendering</a>, which <em>seems</em> like should be the correct way to implement what I want, except I haven't found a decent example of how instanced rendering should work when rendering different fragments to different layers of a framebuffer.</p>
<p>Btw I also <em>think</em> that <a href="https://www.khronos.org/opengl/wiki/Framebuffer_Object#Layered_Images" rel="nofollow noreferrer">a layered framebuffer</a> is the way for doing multiple renders at once, but not sure if this is accurate or current</p>
<p><strong>What would help me:</strong></p>
<p>If perhaps this use case requires more recent OpenGL versions, or perhaps another framework (Vulkan?) this would also be an acceptable answer, as long as some details or examples are provided that I can use to build on</p>

<opengl><shader><frame-buffer>
Rendering multiple camera transforms of the same geometry at once
lurscher
# Rendering multiple camera transforms of the same geometry at once

(Asked by: username_0 on 2022-06-22)

Currently I have a basic (OpenGL 3.3) rendering scheme using a simple depth vertex shader to generate shadow maps for a scene. I don't care about having a large number of lights in the scene so it is fine to do individual render passes to generate each shadow map.

**What I want to do:**

My concern is that I want (or indeed NEED) to render the same scene geometry from many different camera transforms (over 500x) and it is very resource intensive to do one render pass per transform. Besides, reading pixels from the device is slow, so I would rather prefer to draw and fetch as many of these camera renders per call as the hardware allows. The current rendering pass uses a standard Phong vertex->fragment pipeline that relies on the computed shadow maps.

**What have I found:**

Despite all the parallel computing capabilities of GPU devices, I find the OpenGL API regarding shader pipelines somewhat abstruse. I found something called [instanced rendering](https://learnopengl.com/Advanced-OpenGL/Instancing), which *seems* like should be the correct way to implement what I want, except I haven't found a decent example of how instanced rendering should work when rendering different fragments to different layers of a framebuffer.

Btw I also *think* that [a layered framebuffer](https://www.khronos.org/opengl/wiki/Framebuffer_Object#Layered_Images) is the way for doing multiple renders at once, but not sure if this is accurate or current

**What would help me:**

If perhaps this use case requires more recent OpenGL versions, or perhaps another framework (Vulkan?) this would also be an acceptable answer, as long as some details or examples are provided that I can use to build on

**Tags:** opengl, shader, frame-buffer


---

## 1 answers

### Answer by username_1 on 2022-07-01. Score: 1

You might look into "mulitview" it is fairly straight forward to setup and use. It does have limits on the number of views that can be rendered at the same time. Most examples are geared toward VR but it has obvious uses for a wide range of other situations like rendering cube maps. This would still mean multiple render passes but could get the number well under a hundred. It is supported on both Vulkan and OpenGL.


---

