I have a framebuffer with two color textures (GL_TEXTURE_2D). Fragment shader renders to both textures. I would like to set a different width and height for one of the textures and use MRT feature but according to the GL spec there is one issue:
If the attachment sizes are not all identical, rendering will be limited
to the largest area that can fit in all of the attachments (an intersection
of rectangles having a lower left of (0; 0) and an upper right of
(width; height) for each attachment).
When a framebuffer contains textures with the same size I set a viewport this way:
glViewport(0, 0, colorAttachment0.width, colorAttachment0.height);
For a framebuffer which contains textures with different size I have tried to set viewports this way:
glViewportIndexedf(0, 0, 0, colorAttachment0.width, colorAttachment0.height); glViewportIndexedf(1, 0, 0, colorAttachment1.width, colorAttachment1.height);
but it doesn’t change rendering results.
Is it possible at all to use MRT feature when textures have different size (2D textures with different width and height) ?