Filter with multiple inputs/outputs?


I am currently trying to prototype a 3D game, where I want to use a custom filter in post processing and as I understood it from tutorials there is a chain of [java]Filter[/java] objects in a[java]FilterPostProcessor[/java] where the output of one filter is the input for the next one and each [java]Filter[/java] has a set of shaders in it’s [java]Material[/java].

The problem that I have with this is that my filter is a bit more complex and I need the ouput from one shader pass in several other passes, so it is not a chain but more of a net.

So my question is the following: Can I somehow save the frame buffer into a texture for later use? Also, how about having multiple texture inputs for one [java]Filter[/java]?

thanks for your help,

PS: Before someone asks: Yes, it is possible to put all of the filter into one big shader, but I dont want to do that because then execution time grows quadratically with some of the filter parameters instead of linear.

Woah, sorry for the code stuff, I did’nt expect it to start new lines… also, is there no preview-post or edit button?

You have a Pass system in Filters that allow you to do pretty much anything. For example the SSAO filters does an additional pass to render the scene normals.
Also you can make Filters that “interconnects” as you want pretty easily. Each filter will have some textures that has been rendered (the main one, but maybe some in additional Passes), you can just have getters on this filter to get the texture and have setters on other filters to set those textures. The textures are material parameters so you can have as many as the hardware allows you.

1 Like

ah thx, the source of SSAOFilter is very revealing.
and thx for the fast reply too :slight_smile: