Water Shader Help

So I’m working on my water shader, and I’m at the point where I need to test a full scale version to see how it handles performance wise. So what’s the best approach to doing this?

  • Obviously it can’t be running the tessellation constantly (like when you’re far away/it’s out of view), so I need it to only run that when the player is a set distance away (not sure how to do this).
  • I also would like to know if I should just use one really large plane spread around the level or several connecting smaller ones? Strictly performance wise I mean.

Anything else I should know when using this effect on a large scale? Thanks in advance for any help/tips :cool:

already, your water shader is gorgeous! I’d love playing a game just for that water goodness!

Yeah 3-4 days of hard work will do that I suppose :wink:

Also thanks for the compliment! :slight_smile:

Hey guys quick questions for you relating to the water plane setup (I’ve been using one I downloaded sometime ago, so I’ve never made one myself).

So what’s the best way to set up/make a water plane for tessellation like this?
Also Google has failed me on this one, so what are the correct unit measurements for 3dsmax to ue4? Scale is off pretty bad for me atm lol.

:slight_smile: 1cm = 1 uu How does unit scaling work in UE4? - AnswerHub - Unreal Engine Forums

Thank you very much! One question down, so can anyone help me with setting up the water plane? I should be good to go after that last bit :slight_smile:

Also made some slight tweaks to the material in case anyone was interested.

double edit
I think I may just use the answershub page for this, since I’d really like to have an answer sooner rather than later lol (it’s a bit slow here atm). I’ll post back here if I get an answer there, but if you do know please feel free to comment anyway in the meantime.

Got my answer:

This is the solution I’ve been using for distance fades: http://i.imgur.com/Cp5cL6V.jpg
You could keep that as a material function and use it for blending all sorts of things, even whole materials. Just plug in whatever you want, eg for tessellation http://i.imgur.com/L82aGsc.jpg
You can also see an example of pixeldepth distance fade in the Stylized content demo from the marketplace.

Interesting, I’ll have to play around with that now. Thank you for that :slight_smile:

just messed around with it, and it definitely works! Question though, how did you make your own node like that?

The node is made via a material function. You create a MF, then make/copypaste your material network (using inputs instead of scalars for values you want to alter), and when you’re done deselect any nodes in the MF so you can edit the options for it, eg give it a description and expose it to the library so you can access it like any other tool by searching the palette. Be sure to give all the input/output nodes a description so that you can remember what they do down the line, and you can also edit the index number of them to have inputs neatly organized in the resulting node.

Oh very cool, I’m learning quite a bit here lately lol. Thanks for that :slight_smile:

So the larger scale test is done. It works + looks great. Still playing with the colors/normals/settings a bit, but at least all the major stuff is done:

Random question though, any suggestions for anything to use in the emissive slot for something like this? I’ve got it empty atm, but I’m curious if there’s anything I could/should add in there to help spruce this material up a bit more.

You could put a fresnel in there to give you some cool highlights and backface lighting.

Ah thanks, I think I set it up right, so let me know if I somehow managed to mess it up lol. I did multiply it with a dark blue/green, and I think it looks nice, but it’s nowhere near as shiny compared to when I first plugged it in. So hopefully I didn’t butcher it lol.

So tweak list in this version:

  • Tweaked/Increased the shallow/mid/deep distance blend a bit more following some feedback on youtube.
  • Added some Fresnel Lighting to the emissive slot for this following some feedback from here.
  • Also changed how the water normals look close up, so it blends in a clearer normal in the area/water surrounding the player, it seemed too noisy to me before when you got close up to it.

From what I’ve seen, tesselation is likely to have a connection to distance (watch it in wireframe mode, as you come closer, the tesselation looks more detailed). Might be the way the wireframe is rendered though. So one approach might be hooking the pixeldepth input to the tess.multiplier. Another approach might be this one: