Icecode GL wrote:RTT is expensive no matter the context. Right now FPS gets effectively cut in half, since the scene needs to be rendered twice. And by the way, I don't think canvas::Image uses osg::Image, or at least I didn't see it anywhere. It only creates a quad with the size of the image and textures it with the image. The osg::Image is then freed and not used again till the path/image is changed.
For the View element itself, we could maintain a std::map<> for each configured view, so that we only ever set up one texture per view - so no matter the number of views created, there would only be one RTT - we would mainly need to introduce some sort of "ViewProvider" that maintains a cache of requested view textures, and at that point we could check if the previously computed viewMatrix is identical or not, and only re-compute/rebuild the texture if it's different - that should pay off for complex cockpits with lots of screens showing possibly identical views/tailcams.
Obviously, things would become complicated the very instant we start supporting draw-masks per view or custom shaders ...
Anyway, the view element is certainly one of those Canvas elements that would clearly benefit from having support for OSG stats, so that these views do show up in the osg stats.