Water Material. How long will all that bad? And what to do?

I think the SSR is the way to go for simulating the reflections of water for next-gen engines which use deferred shading pipeline.

HL2 used realtime RT for rendering reflections of water, which is exactly the same thing as Reflective Scene Capture in UE3. This technique would be extremly expensive if you use it in deferred render path of UE4. I guess that’s why Epic haven’t implemented it in UE4 yet.

Actually, I’d already implemented this in UE4 by modifying engine source code several months ago. However, the performance was apparently not ideal in practice. When using it in deferred shading render path in UE4, you may lose 1/3 performance overall.

http://s29.postimg.org/9cw8oreyd/111.gif

As for performance…
CryENGINE uses deferred rendering and physically based materials and everything is very fast.
Yes, there is used a few simple scene for reflection but still everything is rendered in a few milliseconds!
I believe that in the epic programmers not worse.
We just need to be paid to this problem enough attention.
In my project realistic water is very important. And I would like to continue using UE4…
[/QUOTE]

CryEngine is also using SSR for water reflections. And it has the same problem near the edges of screen.
Actually, the SSR of UE4 wouldn’t look so bad in an actual game scene. Just take a look at this “Hellblade” trailer, pay attention to the water surface at the beginning of video.
SSR is not perfect, but it’s currently a performance wise solution so far. Don’t forget realtime rendering is always imperfect, it’s all about tradeoff.

Would you be willing to share the code for it, regardless of performance it’s handy to be able to have this functionality :slight_smile:

SSR isn’t ideal, though somehow CD Project RED made it work quite well in Witcher 3. I think they pushed the reflection out towards the edges to get rid of the edge artefacts at the cost of some warping artefacts, which aren’t as noticeable. Besides that they just fell back to a reflection of the sky, easy enough to do even in a deferred renderer if you have the sky cubemap available.

Regardless, for water (and all transparency) one could generate the water texture for the screen in a pass, move that texture to it’s own buffer, and run a separate, minimal shading pass on it to get accurate specular (no uber shader, just the minimal parameters). It’d be slightly complicated to write, but not to shade, think of it as texture space rendering but exclusively for water (not that you couldn’t do such for all things and have a kind of deferred renderer with transparency support, but that’d take a big re-write).

And observing water in most realworld scenarios, the primary specular reflection noticeable at non sharp angles is from the sky. If you could run single sample DFAO from the reflection vector of the water you could get whether the sky is visible (generally) and have a decent approximation for most rivers and etc.

Perhaps this can improve water a little

Don´t had the time to test it in a big but since glass and Water are in a close relation it might work.
But jeah, i also see a downgrade with big ocean scenes. I have used a lot of workarounds like blurring baked render cube maps and so on.

In this recent stream about Custom Materials, RyanB mentioned that they used planar reflections on part of the demo (at 10:05 here: Custom Material Node: How to use and create Metaballs | Live Training | Unreal Engine - YouTube ) they look really nice, would love to see how they were achieved, or if it could lead to some kind of planar reflection system being implemented in the future! If that demo ran on a phone and still looked that good, surely the technique is performant enough to implement?

Check this thread How to create Infinity Mirror?? - Rendering - Epic Developer Community Forums , answer#7 and related

CryEngine is also using SSR for water reflections.
[/QUOTE]

No. I disabled the SSR

That looks like a cubemap, there’s some water leak in the reflection that shouldn’t be there. As far as I remember CryEngine neither has planar reflections; if I remember well you are supposed to do that with probes just the same way as capturing the environment for anything else, and that isn’t real time either.

http://docs.cryengine.com/display/SDKDOC2/Environment+Probes

If you modified Unreal so that capture actors update in real time you would get what you are looking for - but just picture that you would need to render a cubemap at least 1:2 screen size sixty times a second.

I absolute це agree with OP. Unreal Engine це гiвно.

No. Water in CryENGINE has a real time true planar reflection.

In UE4 can this be available in version 4.12 or 4.13
But now this is not possible

It sounds like they actually rendered the objects twice with one being flipped -1 in Z. Probably into a separate buffer? I wonder if something like the VR instance stereo rendering could be done here to render the objects and its reflection object both at the same time. This extra buffer could be sampled either in the material or in post processing to add it to your water place object. But it would require that being written by an experienced dev.

It seems screen space technologies are industrial standards such as screen space reflection and screen space ambient occlusion. I have see SSR being used in AAA titles like Call of Duty Black Ops 3 and Rise of the Tomb Raider.
But I am not saying it looks good. It looks bad, so bad. In Black Ops 3, during the infiltration mission, there are a lot of interior water that lacks of proper reflection. It is not obvious because scene is too dark.
However, in Rise of the Tomb Raider, the water looks even worse. There are a lot of scenes that Lara needs to dive from above into water. When you dive, the sky reflection will immediately disappear and you will only see the water like pure green ink.
2 years ago I tried to make a demo scene using UE4 but I failed because of water, then I switched back to use mental ray to render out image sequences.
Now I am working on another archviz project that contains water…I am currently putting a HDRI into water material to fake the reflection because I am already using dynamic GI, I cannot afford the cost of scene capture…
Although CryEngine is harder to use but the water in CryEngine looks actually good.
BTW, the team made the Vanishing of Ethan Carter is incredible, that game is a legend.

Woah. 4.12 branch has planar reflections. Water for Ocean and lakes is sorted!

Holy ****. Yee that looks nice indeed!

I don’t have the 4.12 preview, how’s performance?

gtx 670 Screen Percentage 100 16.67 ms
50 12.74 ms
25 11.98 ms
SSR only 10.22 ms
Test map screenshots Dropbox - File Deleted
Dropbox - File Deleted
If someone interested, some quality comparisons (I made it for guy who doesn’t have 4.12 yet) Dropbox - File Deleted

that’s very nice, thanks for taking the time to take these

it seems that unless you want a perfect mirror, the 25% is great quality-performance tradeoff.
it’ll probably get slower compared to SSR in more complex scenes (more objects to render), but the performance impact vs the quality increase makes it totally worth it IMO

It seems that many static objects does not have noticeable impact on the performance of planar reflections, but I’m not completely sure about it. Need further research.

Very interesting.
I’ll download 4.12 to play with this by myself but for now I have a few questions :
What are those weird reflections on the floor at the bottom of the walls ?
From what you experimented, is it possible to give any form to the reflective surface (flat circle for example) ?