I’ve been trying to incorporate the SimpleWaterProcessor into my game, however, the effect seems to be 100% reflective which looks beautiful, but more like mercury that water.
To eliminate anything I’ve done wrong in my own game I started with the TestSimpleWater and that showed the same behaviour. I’ve played with SimpleWaterProcessor#setWaterTransparency and SimpleWaterProcessor#setWaterDepth as well as setting a water color with an alpha component and putting the water plane in the transparent bucket, none of which seem to make any difference
So the scene below the water is cutting through, but (as far as my understanding of refraction goes) at the wrong place. I believe that refraction just makes things seem like they are at a shallower depth than they really are, but should never make the red cube appear the wrong side of the JME cube.
SimpleWaterFilter isnot accurate ,I am working on a third person shooter game & made a lake …goes deep but the water from undersurface isnot rendered so anyway I tried using it but it seems that it’s designed to be just a texture …no depth & no real water appearence …as JME wiki states it’s just a couple of textures mixed together …try using Water filter class
Hmm, looks like you are seeing exactly the same problems as me.
I want several small areas of water, rather than a global sea, so I think (unless I’m mistaken) that the water filter wouldn’t work for me, but thanks.
I’m going to try to remember how shaders work and see if I can fix the SimpleWaterProcessor
Hmm, it seems like the artefact is caused by the reflectionPlaneOffset being -5 by default
Setting it to zero makes things intersecting with the water (the JME cube in my image) look weird but setting it to something small like 0.5 makes the artefact go away without any other issues. I’m guessing that parameter does need to be adjusted based on wave sizes etc
Reducing the transparency makes it look less weird but you can no longer see whats below the water.
So I’ve modified the shaders (to be a lot simpler actually) and just had 0.3 * the refracted scene and 0.7 * the reflected scene (no depth, no Fresnel factor) and thats got me a lot closer to what I want
SimpleWaterProcessor will not support this as it has no idea what “in the water” is.
Regarding this thread: I hadn’t really played with SimpleWaterProcessor in probably 9 years so I ran the demos. TestSceneWater seems to behave a little better with respect to transparency… and though it is also using SimpleWaterProcessir. I don’t know what the actual difference is, though.
yeh, I have tried using SimpleWaterProcessor but it creates no actual water thickness & deepness like the WaterFilter does , as JME wiki states , they are just a couple of mixed textures , but i want to make sure of that , anyway i am using WaterFilter & find a way to scale it
May be because they want it to be as less shiny as it can , but why cannot you set it to 10 to be 1 ?
The original version of the SimpleWaterProcessor clamps the input to 1, then divides it by 10
Regarding this thread: I hadn’t really played with SimpleWaterProcessor in probably 9 years so I ran the demos. TestSceneWater seems to behave a little better with respect to transparency… and though it is also using SimpleWaterProcessir. I don’t know what the actual difference is, though.
It does, doesn’t it. I have a very bright sky, I wonder if that makes a difference. My scene under a dark grey sky does show a lot more of the underwater scene. I wonder if there’s some maxing out the pixels issue going on. TestSceneWater also uses a real light source, while my light is all pre-baked
Aint that the truth. But I’m fairly happy with my 70% reflected scene + 30% refracted scene, I’m sure I’ll find a corner case it doesn’t work for soon enough though
waterProcessor.setWaterTransparency(1000.0f);
waterProcessor.setWaterDepth(0.1f); // transparency of water
waterProcessor.setWaterColor(ColorRGBA.Orange);
As wiki says, this is for puddles and fountains, i,e non navigable, shallow water.
The SimpleWaterProcessor has less performance impact on your game than the full featured SeaMonkey WaterFilter; the main difference is that the SimpleWaterProcessor does not include under-water effects.
I am not sure if an object intersecting the water plane is the determining factor for depth, or why there is such a large range for the variables but there it is.