Download

Water refraction corrupt

Hey Guys,
do you know why my water refraction is corrupt?

If I rotate the Camera there is a line which cuts the water in a refracted and unrefracted part.

http://www.bilder-upload.eu/thumb/c5eac5-1471023324.png

http://www.bilder-upload.eu/thumb/390f3b-1471023346.png

My material is really simple:
http://www.bilder-upload.eu/thumb/5af4ed-1471023284.png

EDIT:
Water created with this way is actually not possible anymore in UE 4.12.5. Do you know an other way?
https://youtube.com/watch?v=FMVCVH7zuGI

I do not reckon seeing any changes in 4.12.5 that would make you unable to reproduce the tutorial. Maybe the refraction value you are putting is just too high ?

It is not the problem to reproduce the material. The Problem is, that there is a cut at the material which splits the material in a refracted and not-refracted part. It seems, that the cut appears everytime at the same distance to the upper viewport edge.

Screenshot 2016-08-12 19.20.00.jpg

Your refraction is way, way too high. Set it to something more reasonable like 1.1.

Okay, I reduced the refraction… but take a look. The refraction is too low and the problem is still there. If the refraction is 1, there is no refraction left and the problem is not visible :stuck_out_tongue:
If I set the refraction to -1 the problem appears on the bottom edge of the viewport

Idk what is wrong :stuck_out_tongue:

Screenshot 2016-08-13 11.00.31.jpg

That’s just how refraction works. Either make smaller details to break up the remaining hard edge or fade it out at extreme angles. You can’t use refraction to see something not already in the viewport, that’s why it’s having these issues. You’re asking it to render something it doesn’t have any information about. It would work just fine if Unreal was using raytrace rendering, but unfortunately it’ll be a few decades until that’s viable for games.

Is there any reason why you’re not using a Fresnel term? afaik you should always use at least a Fresnel term for refraction. You’re currently only inputing an constant IOR. Try to use a lerp combined with Fresnel. Also you can use DepthFade in addition.

regards

Yes I tried it with this tutorial: https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/HowTo/Refraction/

How can i fade out the refraction at spots where it is not possible to refract :stuck_out_tongue:

My next question is, why tries the refraction, to refract something abouve the water? It should only refract things under the water. That is why it has the cut which I discribed on the top of the thread, because some things over the water are outside the viewport and can’t be refracted. I tried the same with the Source Engine and CryEngine… they are refracting it correctly, only things under the water.

Edit 1: Reflection is disabled :slight_smile:

Unbenannt-1.jpg

Screen space refraction works by taking a copy of your screen and transforming it to fake the refraction. There is no regard given for what is above or below water. You can minimize those issues by using Fresnel and depth fade, as it was expressed in posts above.

Okay guys, I solved my problem. I found out, that the normal and refraction must be the same like this:

http://www.bilder-upload.eu/thumb/837f92-1471193336.jpg

And my result looks like this:
http://www.bilder-upload.eu/thumb/efbda2-1471193265.jpg