ramses icon indicating copy to clipboard operation
ramses copied to clipboard

The color buffer slot for an offscreen render buffer should not depend on other render buffers

Open AchimStremplat opened this issue 2 years ago • 1 comments

Usecase: In Ramses Composer while building an offscreen render target and working with it, it can easily happen that one of the offscreen render buffers becomes invalid (e. g. its size does not match anymore). This currently causes all buffers in the same render target after the invalid buffer to change their GL_COLOR_ATTACHMENT index (shift forward). For more complex rendering scenarios with more than one render buffer on a target, this can get quite confusing, as the user-defined shaders rely on specific offscreen buffers being in specific slots.

Suggestion: It would be nice if RaCo could specify the color attachment index when setting up the render target, e. g. either if there would be an additional functions RenderTargetDescription::setNumberOfColorRenderBufferSlots(int) and RenderTargetDescription::setRenderBuffer(int colorIndex, const RenderBuffer& renderBuffer). If this is possible, empty slots could be passed on to glDrawBuffers as GL_NONE?

AchimStremplat avatar Sep 27 '21 09:09 AchimStremplat

Hi @AchimStremplat ! We discussed this and it would definitely make sense to implement a way to have empty buffer slots. The problem is that this would mean a breaking change in RAMSES and we can't do this in the current (27) version of Ramses without bumping the version. We will do this with the next RAMSES version (28)

violinyanev avatar Nov 02 '21 08:11 violinyanev