.

.

How do you initialize the waterProcessor?

I’m not really sure of what’s happening in your video, but you don’t have a sky. The reflection does not take the background color into account.

Maybe you should try to setup a sky box.

@nehon: does the water filter somehow take the alpha color into account? Because the only thing that is different between background color and sky is alpha might not be 1.0.

No it’s not the waterFilter, it’s the way reflection is redered.

It uses another viewport, so i guess setting the background color of the main viewport shoul fix it, but, I don’t think this problem is only a matter of background, something seems odd.

@normen: I assumed incorrectly that noone had reacted to the artifacts, I tried to delete the old post, didn’t work. I you look in the picture beneath it properly reflects the view in the reflection viewport, but it doesn’t match the main view. The reflection viewport is located or oriented differently from the main viewport and thus reflects things it shouldn’t it seems. But it really is better if you see for yourself live.



The transformation under in TestSceneWater.java, reproduces the problem:

[java]

cam.setLocation(new Vector3f(36.63214f, -15.051128f, 39.71877f));

cam.setRotation (new Quaternion(0.09027442f, 0.27534965f, 0.0030846794f, 0.9570912f));

[/java]

This artifact is due to the position of the clipping plane when rendering the reflection.

you can play with the setReflectionClippingOffset method. There is no magic value, you have to tweak it depending on the scene, that’s why i made an accessor. For the TestSceneWater a -0.25f value give acceptable results.



waterProcessor.setReflectionClippingOffset(-0.25f);

1 Like

Thanx, I actually found out myself :slight_smile: It initially striked me as a bug that couldn’t be tweaked, but I understand now. What advantage is there to setting the clipping offset to -5 as the default is set to?