I would like to apply a basic blueish filter color to (part of) objects located under water, like in the image below (the base of the mushroom is blueish, compared to the top) :
I wonder how I could achieve this result with JME.
The solutions I could think about so far are :
- use a closed transparent geometry for the water : does not work when the cam is inside the water since objects inside the water geometry do not get the filter effect. Moreover, that increases the number of triangles.
- a post processing filter ? never tried that but how could I apply the filter to only the pixels located under the water surface ?
- a shader ? same problem, how to know whether the pixel is above or under the water ?
- a geometry “curtain” just in front of the cam ? Don’t know how to shape the curtain geometry so that only underwater objects get the effect (use the frustrum near plane ?).
Any clue would be appreciated