Anyone gotten 'Water2' to work while looking upward from underneath the water surface?

I tried setting it to double-sided but it didn’t help much. I was hoping to get the expected refraction effect from underneath. Just wondering if there’s an easy workaround, although I did also just find these really nice alternatives that seem worth a try:

A possible alternative that looks quite nice:

And this one looks promising, although the demo exposes no settings:

The GPU Water in examples is way too slow on my NVIDIA GeForce RTX 2080 unfortunately.

1 Like

For refraction from water need posteffect and render scene twice with depth and color.

3 Likes

Thanks for the link. Cool demo! Before I go digging into the source, would you mind elaborating a bit on how to render the world above the water, if the camera is below the water?

I’ve already got an ‘underwater’ post-processing effect – it’s the rendering of the world, refracted, when the viewpoint is under water that I’m unsure about, and I’m wondering if it’s possible with Water2. Thank you.

Before rendering, render to texture a scene without water. To determine the display of the water line, you need to create another water geometry in the form of a cube and make its waves coincide with the first wave. The outer part of the cube should be black, the inner part of the cube white. Before rendering, you need to render the cube and save it to a texture, so that later in the post effect you can use it for the water line - black color - just a scene, white color - a scene with the color of water. The depth texture is needed to change the color of the water depending on the depth.

I seem to recall that you can make a copy of the water plane, and flip it upside down. set the top to side:THREE.FrontSide and the bottom to THREE.BackSide.

If the water mesh is flat , flip that mesh upside down when the camera’s Y position goes below the water mesh’s position Y.

you might also need to hide the meshes below the water when below the water

jsFiddle fixed

1 Like

Hey, thanks! The video looks promising and that seems reasonable and simple to implement. I’ll give that a shot.

(BTW the jsfiddle appears to be broken: “[Line 76] Uncaught ReferenceError: groundMesh is not defined”)

Oh, and about this:

you might also need to hide the meshes below the water when below the water

how come? I can’t see why this would be a problem.

Thanks!

1 Like

Ahh my bad , forgot to save my edits in the jsfiddle.. link fixed now

When the camera goes below the water the ground mesh still shows up in the refraction even though it’s backside is invisible… easy fix for that was to hide the underwater mesh…

1 Like

This was what I was looking for and is super helpful. Thank you, @vis_prime!

1 Like