Bloom Filter for multiple nodes

I have a scene where I want to apply a bloom filter to both my regular viewport and my gui viewport. When I apply bloom to only the gui viewport, the engine doesn’t render the normal viewport. When I apply bloom to both viewports, bloom doesn’t work at all. It only works on the regular viewport.
How do I enable bloom for both viewports?

I’m pretty sure you can’t. The way the post processor works it obliterates any previously drawn viewports.

If you want GUI elements to be post-processed with the scene then you can put them attached to the regular root node but in the Gui render bucket. They will still be positioned just as if they were in the gui viewport.

It’s actually too bad that we can’t somehow make the post processor span multiple viewports because I also had this issue with two 3D viewports that I was trying to render layered.

That’s a shame. I’ll try to get that working later. I changed my UI elements to the GUI bucket and it broke my picking method.

Thanks anyway.

<cite>@Shard said:</cite> That's a shame. I'll try to get that working later. I changed my UI elements to the GUI bucket and it broke my picking method.

Thanks anyway.

Picking should still work if you pick against the right node. If it were me, I’d make my own guiNode, attach it to the root node and put it in the Gui bucket… then change picking to pick against that gui node.

A workaround to this is to set your own frameBuffer as the output of the main viewPort. The post process filters will be rendered to this framebuffer.
Then set the guiviewport clear color with any color with an alpha 0, and make a Filter that will be able to be fed with the previous viewport texture and compose it with the gui viewport render texture.
than add this ComposeFilter first to the list of filters of the guiviewport filter processor, then add any additional filter to have the required effect.
A nice side effect with this is that you can play with the filters orders so that some effect applied to the guiviewport are not applied to the mainviewport.

Actually I’m gonna try this.

Ok I’ve committed a Filter and a testcase in the last SVN
See the files here https://code.google.com/p/jmonkeyengine/source/detail?r=10592