The stretched reflection of waterMaterial and some parts of the back that are not drawn

This is the same issue as the following two topics

When viewed horizontally, the reflection appears to be stretched, and when viewed from below, it appears to be removed by that amount.

This can be prevented to some extent with camera’s minZ, but it doesn’t solve the root cause. Is there any way to improve this or find a solution?

PG link

2 Likes

I ll try a trick to fix it

2 Likes

This should do it Workaround water material issue at grazing angle by sebavan · Pull Request #17104 · BabylonJS/Babylon.js · GitHub

4 Likes

This issue was haunting me as well a while ago. I “solved” it by locking the viewing angle :smiley:

Well done @sebavan, looks really good! Thx!

You can also use NodeMaterials if you need to customize or do something different like this:

Based on @roland and @qkrxotn7287’s discussion here:

3 Likes

This is the moment when a long-standing problem is resolved.:grinning_face_with_smiling_eyes:

As for the back, the water material was not made considering it (the appearance under the water), so the back was added separately like the final PG.

PG Link

Separately, I checked that the extended reflections for regular refractive textures, not water materials, are generally accurate.

1 Like

As you mentioned, I know other great users have created or recommended different versions of water shaders, and I’ve also created different water shaders with them in the past.

however…..

This time, I was making a separate glsl that works similarly to the existing water Material, but I lost to the calculation of reflection and refraction.:sob::sob::sob:

2 Likes

Use Schlicks approximation to start. Here’s a small presentation on the basics. I hope this helps you get a basis for yours.

3 Likes

Looks so good!

4 Likes