OGRECave / ogre

scene-oriented, flexible 3D engine (C++, Python, C#, Java)
https://ogrecave.github.io/ogre/
MIT License
3.91k stars 963 forks source link

RenderSysten_GL: Prevent using a shared FBO renderbuffer if necessary #3168

Closed FrankGoyens closed 1 month ago

FrankGoyens commented 1 month ago

A shared renderbuffer might contain data from other FBO's, this is fine as long as all viewports have clearEveryFrame=true. When any viewport has clearEveryFrame=false, data would get unintentionally combined.

This fixes #3158

FrankGoyens commented 1 month ago

This approach switches between a cached and an owned (uncached) renderbuffer. So far only implemented for RenderSystem_GL which is easier if some changes have to be made, since GL3Plus and GLES2 are very similar in this regard. So GL3Plus and GLES2 would be added later in this Pull Request if GL implementation is OK.

paroj commented 1 month ago

looks good to me. However, I would directly implement this in the common classes, instead of adding GL3+ & GLES2 later

FrankGoyens commented 1 month ago

Thanks for the help, have a nice weekend