0

For example, I have two transform matrix: WVP_Left and WVP_Right.

Can I render geometry (like a rabbit) using instancing to generate left texture and right texture?

The left texture should just have only one rabbit with the WVP_Left effect, and the right texture should just have one rabbit with the WVP_Right effect.

For now, I get two textures which both have 2 rabbit with some overlap part.

How can I fix it?

I don't want to render the left and right scene into one texture, and split it to 2 texture in another pass.

Also, I don't want to use geometry shader to finish the thing, because geometry shader will add the workload of GPU

Xin YANG
  • 81
  • 1
  • 9
  • 3
    *"because geometry shader will add the workload of GPU"* And you assume that instancing wouldn't add to the workload of the GPU? Afaik, what you want is impossible. You already mention all the methods available for rendering to two textures at the same time, either use one of them or render the textures one after the other. – BDL Mar 10 '18 at 10:23
  • 2
    The rasterization and fragment processing has to be done twice in any case, the only potential benefit is reducing some redundant vertex processing bits and draw call overhead. The geomerty shader could be completely avoided by [`ARB_shader_viewport_array_layer`](https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_viewport_layer_array.txt), though. – derhass Mar 10 '18 at 12:02
  • @derhass is it means that i can use ARB_shader_viewport_layer_array + instancing to achieve the goal? – Xin YANG Mar 11 '18 at 06:25

0 Answers0