is there any way to draw to multiple render targets at once which have different sizes or number of samples? It has not been possible for years, but I hope I just missed some extension that could help me. Here is the thing: In various applications, the geometry to be rendered is generated on the fly in either the tessellation or geometry shaders. This can be quite an expensive task, so you’d want this step to be executed only once per frame. Now you want to shade the result once for your main render target (RGBA8, Full-HD with MSAA), and once you need e.g. the normals in RGB16F for SSAO, but a quarter of the screen resolution will suffice for this. (How) can you render this in one pass in OpenGL?
As far as I know, traditional MRT still do not support different sizes among the textures/renderbuffers. The second possibility is layered rendering, which also requires the layers to be of the same texture and thus the same size and format, and furthermore requires to rasterize the geometry twice. It is clearly not an option to make the normal texture a Full-HD 8x multisample texture just for the sake of simplicity, the waste of VRAM (of which I have too little, thus the question) is insane.
I had the idea to do this all in the fragment shader via image load/store and write the normals there, but to be honest, this does not seem like the proper way to do it.
What I need and want is:
- writing multiple values from one fragment shader invocation
- the render targets for the values have different size and sample count (or even mixed TEXTURE_2D and TEXTURE_2D_MULTISAMPLE)
- only one geometry shader invocation
- in one draw call
Anyone? I’d be glad to get some comments on this.