I apologize ahead of time for any of the typos and mindless babble that low sleep and lots of coffee induces that may pop their way in here:
I've spent the past few hours hacking together some basic capabilities to use multiple pipelines. Thus far I haven't tested anything too heavily. There are also probably better ways to do it as this was the result of a 3 hour "can't sleep" research and hack fest. Despite that, I only notice a 5 fps hit against 160fps average. I haven't check mem consumption but vector should be pretty good on keeping it down.
It's done through turning vector< PipelineCommand > _pipelineCommands; into a vector<vector<PipelineCommand> >.
Assuming Y is vertical and X is horizontal this means that each Y is its own unique pipeline. Nothing overly spiffy has been done yet in regards to dealing with renderbuffers and such. As renderbuffers are left untouched it should therefore be possible (in theory) to use a renderbuffer from a different pipeline without ever defining it for your current pipeline. If you screw up and don't load that buffer then you're pretty much SOL at the moment.
A few extra little gootchy-woos are added, all of the default functions exposed to a program using Horde still work as expected
, but some new ones have been added configPipeExtension(), renderPipe(), and renderMultiPipe(). configPipeExtension loads a pipeline explicitly as an extension. renderPipe(int) allows the scene to be rendered only through the chosen pipeline. renderMultiPipe(int*,int size) is designed to take an array and render through any setup of pipes that are loaded (e.g. 0,1,8,4,1 etc) in the order specified in the array.
So you could render using pipe 1 through a designated camera into a buffer which you could use as a reflection buffer for for pipe 0 through another designated camera. Provided you do the alternation of the active camera and use the appropriate render function in your application.
I have not tested it yet (still need a better pipe setup to try it out) but I've also added a function which will set the data of a uniform of from a pipeline in memory. Kind of redundant since you could ignore this capability of pipelines and get straight to the material's uniform.
Right off the bat:
Problems:
-There's no way to remove render buffers associated with a specific pipeline (unless you toast everything)
-Once you load an extension pipeline, you're stuck with it (unless you toast everything again)
Other things to solve: (+ is gauranteed, - is not)
+Thorough debugging and optimizing (maybe some use-case testing)
-Hook up support for multiple pipelines being defined in a single xml file
-Selective loading of them perhaps?
+Dealing with the other issues of render buffers
-names for the pipes would be nice
+General management of the pipes
-Maybe some "smart camera stuff" like swiftcoder suggested in a prev. post of his/hers/its/I-don't-know
-It's not directly related (well it kind of is) but implement that desired ability to access buffer data in materials
-A "random pipe" function could be amusing
What can this approach do (maybe with some other work):
-Toolset case example: Highlighting things by class
-Game case example: damage blur post process effect
-General case example: imposters, reflections, etc
-Really general case example: general case stuff it'd be useful for
Now for mandatory screenshots:
First: Using only the regular old pipeline
Second: using pipelines 0 and 1 (turned ON/OFF via spacebar)
The contents of the pipeline loaded as an extension:
Code:
<pipeline>
<CommandQueue>
<Stage id="Blue">
<SwitchTarget target="" />
<DrawGeometry context="Blue" class="" />
</Stage>
</CommandQueue>
</pipeline>
I'm going to work on solving the thorough testing problem and a wee bit of restructuring today.
If anyone would like to help speed things along I'd certainly appreciate any pipelines, materials, shaders you can whip up for either of the existing demos.
Also any advice, commentary, thoughts, misc. errata, and anything shy of fish with worms are welcome.