Project Rembrandt: Difference between revisions

m
→‎Status ?: update with status & quotes from the forum to provide a few pointers because this keeps coming up on the forum/issue tracker, can be removed once the status changes...
(+ <references/>)
m (→‎Status ?: update with status & quotes from the forum to provide a few pointers because this keeps coming up on the forum/issue tracker, can be removed once the status changes...)
Line 1: Line 1:
<!-- {{WIP}} -->
<!-- {{WIP}} -->
== Why this name ? ==
== Why this name ? ==
[http://en.wikipedia.org/wiki/Rembrandt Rembrandt] was a dutch painter living in the 17th century, famous as one of the master of [http://en.wikipedia.org/wiki/Chiaroscuro chiaroscuro].
[http://en.wikipedia.org/wiki/Rembrandt Rembrandt] was a dutch painter living in the 17th century, famous as one of the master of [http://en.wikipedia.org/wiki/Chiaroscuro chiaroscuro].
Line 6: Line 7:


{{forum|47|Effects & Shaders}}
{{forum|47|Effects & Shaders}}
== Status (07/2014) ==
For the time being, Rembrandt's main developer (FredB) is not actively involved in FlightGear, and Rembrandt must be considered "unmaintained" currently.
{{FGCquote
  |Personally, I see the potential of deferred rendering, but if it ends up with 15 fps on a gaming rig, then that's what it's going to remain - potential waiting for the next or next-to-next hardware generation. For me personally, real secondary light sources and shadows aren't a big deal. They're important on the ground, at an airport, but I'm usually flying. <br/>
<br/>
Self-shadowing of the terrain can be done in 90% of the cases accurately without Rembrandt because the terrain is rarely that steeply sloped, and the interesting other shadows in nature - clouds and trees - can't be done by Rembrandt in any case.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=204372#p204372
    |title=<nowiki>Re: A long shot</nowiki>
    |author=<nowiki>Thorsten</nowiki>
    |date=<nowiki>Thu Mar 27</nowiki>
  }}
}}
{{FGCquote
  |Rembrandt is just one  particular (and experimental) implementation of deferred rendering implemented via FlightGear - when running other simulators/games -with comparable scenes (not necessarily 400km of visibility!)- you'll see that performance isn't typically that much affected. So I guess there's nothing wrong about Rembrandt per se, but it just isn't very optimized at the moment, and it not being maintained doesn't really help. A few weeks ago when we exchanged screen shots and Rembrandt stats, there were apparently a few low-hanging fruits, and Rembrandt was obviously doing stuff that wasn't really necessary (e.g. computing shadows at night time without any light sources within 50km...)
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=204374#p204374
    |title=<nowiki>Re: A long shot</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Thu Mar 27</nowiki>
  }}
}}
{{FGCquote
  |The situations I'm aware of were deferred rendering is used are frequently first person shooters. From the ground, where you have plenty of objects obscuring each other, deferred rendering would give you a pronounced boost in framerate as you spend minimal time with vertices you're not going to see.  That advantage never really materializes for a flightsim.<br/>
<br/>
Imo, what makes our performance in comparison worse than other software where a large scene is rendered is the lack of a terrain LOD system. Our vertex count just explodes at high visibility. <br/>
<br/>
I mean, FredB obviously spent quite some time with Rembrandt. If someone can make it run much faster, than that'd change the game, but so far we have mostly talk.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=204375#p204375
    |title=<nowiki>Re: A long shot</nowiki>
    |author=<nowiki>Thorsten</nowiki>
    |date=<nowiki>Thu Mar 27</nowiki>
  }}
}}
{{FGCquote
  |So we would need to extend CanvasElement then to support effects - according to some of your postings, you played with that already a while ago using code from SGMaterialAnimation apparently, as in 2 years ago ? Is that something that we should reuse ?<br/>
<br/>
Specifically, I've been in touch with some of our effects/shader guys, and we're wondering if we could directly register a Canvas/Effects texture as a texture available to effects, which is something that Thorsten and Tim talked about a while ago, being a limitation in effects that they would like to get rid of
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=201852#p201852
    |title=<nowiki>Re: </nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Tue Feb 25</nowiki>
  }}
}}
{{FGCquote
  |this all predates Canvas - but if we could not just support glsl/effects in Canvas, but also expose those canvas textures to the effects system, that would bring a lot of possibilities
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=201852#p201852
    |title=<nowiki>Re: </nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Tue Feb 25</nowiki>
  }}
}}
{{FGCquote
  |regarding Rembrandt in particular, we are only missing 2-3 [[Canvas]] enhancements to allow effects/shader guys to pick up where FredB left off - which are primarily,
# camera support
# effects/shader support
And people have this working in various stages already, sometimes unrelated to [[Canvas]] (Zan's newcameras branch), and sometimes not yet fully integrated (e.g. the shader stuff). But generally it is foreseeable that additional rendering schemes (deferred rendering) could then be implemented by people without having to touch any C++ code.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=204338#p204338
    |title=<nowiki>Re: A long shot</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Wed Mar 26</nowiki>
  }}
}}
{{FGCquote
  |So, it's not really '''Rembrandt''' that's the issue here, the bottleneck is the number of active expert C++ developers (you cannot really touch the 3D parts of the simulator with "just" C++ knowledge, you also need strong maths skills and OpenGL/OSG 3D rendering experience), especially once they're no longer around to help integrate their code and if there's little documentation to help newcomers maintain their code, because that's when base package development is often taking over eventually.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=194296#p194296
    |title=<nowiki>Re: What frame rate (fps) do you have?</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Mon Nov 18</nowiki>
  }}
}}
{{FGCquote
  |For example, I think it's pretty safe to say that the '''Canvas''' system was never intended to "compete" with '''Rembrandt''', and most people here will be wondering how it could possibly be competing at all ? But ultimately it really is an integration and accessiblity issue, too. Admitedly, you need to be familiar with the way the project works to foresee what could be happening here, but it's not really far-fetched at all:<br/>
<br/>
I had a quick look, and according to the initial '''Rembrandt''' commits by FredB, they were all about decoupling rendering into multiple stages and doing offscreen rendering to textures. This is also supported by the wiki and the initial '''Rembrandt''' discussions on the devel list. So far, straightforward to understand - even without knowing any GLSL.<br/>
<br/>
So basically it's about decoupling each rendering step and rendering each stage to a separate offscreen texture, and then it's mostly about exposing each rendering step/stage to the effects/GLSL framework for further processing there.<br/>
<br/>
'''Rembrandt''' obviously predates the '''Canvas''' system, but these days that's exactly what the '''Canvas''' is good at: offscreen rendering to an osg::Image, without having to touch any C++ code, and without having to build FlightGear from source.<br/>
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=194296#p194296
    |title=<nowiki>Re: What frame rate (fps) do you have?</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Mon Nov 18</nowiki>
  }}
}}
{{FGCquote
  |Tim Moore (developer of the effects framework) did mention several times how it would be great to extend the effects framework to allow  arbitrary textures to be used as inputs/outputs for the effects frame. For example, see: [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37873.html http://www.mail-archive.com/flightgear- ... 37873.html]<br/>
<br/>
So consider a '''Canvas''' texture as the potential input/output for an effect, and there you have it: '''Canvas''' + effects/shader {{=}}&gt; one important ingredient for a '''Canvas'''-based '''Rembrandt''' port.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=194296#p194296
    |title=<nowiki>Re: What frame rate (fps) do you have?</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Mon Nov 18</nowiki>
  }}
}}
{{FGCquote
  |we also have dozens of feature requests from aircraft developers to allow scenery views to be rendered as cockpit textures, e.g. to render mirrors or tail camera images. A feature also commonly seen on FSX and XPlane. <br/>
Several years ago, Zan made lots of progress doing this sort of thing, long before the '''Canvas''' again - so it's also an integration issue.<br/>
<br/>
These days, this would require the view_mgr code to be adapted and turned into a '''Canvas'''::Element. For example, see:<br/>
[http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg36673.html http://www.mail-archive.com/flightgear- ... 36673.html]<br/>
[[Howto:Use_a_Camera_View_in_an_Instrument]]<br/>
<br/>
Other aircraft developers have asked for effects/GLSL being available to cockpit textures for other reasons, e.g. to implement night vision views/FLIR imagings. And supporting effects/shaders in '''Canvas''' has been discussed various times on the forum too.<br/>
<br/>
So, these are just two new features: 1) making effects/GLSL usable to '''Canvas''' textures and 2) rendering scenery views - and suddenly you have two major ingredients for a deferred shading scheme in place, without requiring extensive C++ changes, and without necessarily having to even look at '''Rembrandt''' ...
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=194296#p194296
    |title=<nowiki>Re: What frame rate (fps) do you have?</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Mon Nov 18</nowiki>
  }}
}}
{{FGCquote
  |I don't think that anybody is working on replacing '''Rembrandt''', but I also don't think that we have any active core developers who could easily help maintain '''Rembrandt''' (except for FredB obviosuly) - still it is foreseeable that the '''Canvas''' system will -eventually- provide all essential building blocks to allow deferred rendering to be built on top, it's really just a matter of time.<br/>
<br/>
At that point revisiting the '''Rembrandt''' code and moving its rendering stages into cascaded '''Canvas''' textures that make use of scenery views and effects/shaders with an osgViewer-based placement, would be straightforward for any GLSL developer, much more so than getting to grips with the underlying '''Rembrandt''' C++ code itself. <br/>
<br/>
So, nobody  is working on revamping/replacing Rembrandt, but even if it  were to continue to be stalled, the idea could still evolve - C++ templates were also never intended to be turing-complete, it just happened by accident :lol:<br/>
<br/>
As we know, even for good ideas, it usually takes ~3-5 years for them to be implemented (remember: OSG port, '''Rembrandt''', '''Canvas''' etc).<br/>
<br/>
So I still wouldn't hold my breath. But re-considering the way '''Rembrandt''' is done and integrating it with the '''Canvas''' system would help make it less obscure and more accessible to effects/GLSL developers, especially for times when there are no C++/3D experts around.
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=194296#p194296
    |title=<nowiki>Re: What frame rate (fps) do you have?</nowiki>
    |author=<nowiki>Hooray</nowiki>
    |date=<nowiki>Mon Nov 18</nowiki>
  }}
}}


== What is it ? ==
== What is it ? ==