Convert PostProcessor to PostFilter [Help]

Hi guys.



I recently made simpleRefraction postprocessor (based on simpleWater postProcessor). But i think that postFilter is more advanced for such an effect.



I’m trying to convert my postProcessor to postFilter. But the filter is applied to entire scene (not separete objects). Can you help me to convert the processor to filter correctly? Thanks a lot!!!



Here my code:

Filter and Processor code - http://code.google.com/p/jme-glsl-shaders/source/browse/#hg%2Fsrc%2Fcom%2Fsimplerefraction

Matdefs - http://code.google.com/p/jme-glsl-shaders/source/browse/#hg%2Fassets%2FMatDefs%2FSimpleRefraction

Shaders - http://code.google.com/p/jme-glsl-shaders/source/browse/#hg%2Fassets%2FShaders%2FSimpleRefraction





Screenshot for explanation what i have now:

http://i.imgur.com/J5iLI.jpg





Thanks.

Why did you go the filter way if you don’t want to apply it to the whole screen?

Looks like it works fine with a SceneProcessor.



If you want to apply it to only some objects you’ll have to render a black and white mask of some sort or use the stencil buffer maybe…

But it’s gonna be a lot more complicated and may not be faster.

What bothers you with the sceneProcessor approach?

@nehon said:
Why did you go the filter way if you don't want to apply it to the whole screen?
Looks like it works fine with a SceneProcessor.

If you want to apply it to only some objects you'll have to render a black and white mask of some sort or use the stencil buffer maybe...
But it's gonna be a lot more complicated and may not be faster.
What bothers you with the sceneProcessor approach?



I just thought that filter is more advanced. Then i'll live everything as it is. Thanks for the reply!