Reflections / Water - Object in Reflection Has Giant Scale?

My goal is a non-flat water surface, with reflections on it.

A plane with the y-value of vertices displaced.

Let’s start with a flat surface, and reflect a ball on a plane below.

You can see in this example that the size of the sphere in the reflection does not match, https://jsfiddle.net/rzn4Lxf6/

If you toggle showOrig to true, the reflective material is on the ball, and it has accurate reflections. But when I try to put the reflective material on the plane (showOrig = false), the ball appears 10x larger. What’s going on??

I would just use something like “Water2”, but it does not work out of the box for a non-planar surface.

edit: I read that “lack of parallax correction on the cubemap” is causing the issue. If so, is there a different technique to use for near-plane-like surfaces, or do I try to add parallax correction?

Related:
(advice is use CubeCamera for volumetric, Reflector for plane, but my case is deformed plane)

edit2: checking out SSR from realism-effects lib

I once had a similar project. The qubecamera must be linked to the scene.

scene.add(cubeCamera2);

and the position must be set during rendering: animate()->
cubeCamera2.position.set(camera.position.x,-camera.position.y,camera.position.z);

One axis must be set to negative.

Edit:

cubeCamera2.position.set(camera.position.x,-camera.position.y + 0.6,camera.position.z);

and the position of the reflecting object must also be taken into account.

That does change the result, but in the fiddle it seems to produce an incorrect result also.

This might have some relevance, but it’s been a while since I worked with any of this.

1 Like