When I rotate the “ground” and “waterMesh”, it will become like this.When I moved the camera, I could clearly sense two different refracted colors.Is it a problem with my code?Thanks for informing me.
expect:
but:
When I rotate the “ground” and “waterMesh”, it will become like this.When I moved the camera, I could clearly sense two different refracted colors.Is it a problem with my code?Thanks for informing me.
expect:
but:
Maybe @julien-moreau would know as IIRC he was the daddy of it ?
Hey @late-autumn-give-ear !
You can use water.disableClipPlane = true;
Updated playground: https://playground.babylonjs.com/?inspectorv2=true#1SLLOJ#4327
But according to the current angle it may cause “invisible reflections”, you’ll see what I mean when testing the updated playground. The water material was initially designed for surfaces that are parellel to the ground, the way reflections are computed may need an update. In that case @sebavan is there someone to focus on it in order to help me? I have already so much to do.
That would be a nice update indeed i guess we should open a feature request on the forum for it to see how/when this can be addressed
@late-autumn-give-ear It’s time to make your Christmas list ![]()
ChatGPT:
When you rotate a mesh that uses Babylon.js WaterMaterial, its internal reflection and refraction buffers do not rotate with the mesh.
This creates the visual artifact you’re seeing: two mismatched colors, “slices,” or sliding distortions when the camera moves.
WaterMaterial renders the scene twice:
Both passes assume the water plane is axis-aligned:
water normal = (0, 1, 0) // must face UP
When you rotate the mesh:
waterMesh.rotation = new BABYLON.Vector3(Math.PI/4, 0, 0);
…you break the assumption.
The material still thinks the water is horizontal, but the geometry is tilted, so reflection/refraction textures no longer map correctly → distorted colors and seams.
In Babylon.js, the built-in WaterMaterial cannot lie on a slanted/rotated surface.
It must always be absolutely horizontal.
FIX:
water which skybox reflection but with plain color background | Babylon.js Playground
Thank you.I got it ![]()