Swampy water shader WIP - Shader available for DL if you want it!

Working on a shader for a swampy nasty body of water.

**Pastebin of the node network available below - copy it into your buffer and past it into your own project (you will need to use your own texture samplers though)

Here’s the network - I cribbed the world displacement nodes from an Epic example. I’m doing the blending between the nasty pond scum and the central texture using depth blending. This won’t work in all cases, but it’s close enough for what I need and if you keep the blends subtle it works pretty well. I need to go back in and pack the textures optimally, I could probably cut the number of texture samplers used here down by a factor of 4x at least. Haven’t wrapped my head around how to use flow maps just yet, but that would further improve the look of this no doubt.

I also need to blend the refraction at the edges, as this will fix the hard line you see at water’s edge, and the artifacts you see around the rock. For a more realistic game, some tessellation could really help as well.

Pastebin: Begin Object Class=MaterialGraphNode_Comment Name="MaterialGraphNode_Comment_8" - Pastebin.com

Looks pretty good, though I have some feedback for you. I’ve made multiple kinds of water shaders over the years (between UDK and UE4), and what you have looks pretty good. However, because this is for a swamp, I think the way you are generating displacement does not work well. I created a network, based on some tutorial I can’t remember, that would work much, much better in this situation. You can see it in action, as well as a picture of the network, on my portfolio: http://millansingh.com/312004/4046202/projects/desert-oasis-a-5-day-challenge. All you need for this is a single tiling noise texture (I used difference clouds in PS, but you could try other methods of creating noise as well, as long as they are tiling. I never tried another method, but I am sure you would get some very interesting results.

Further, it looks like you are using a translucent shader, based on the depth fade usage. While you can get some cool results this way, I would try making a version that is opaque. The reason I say this is because swamp water isn’t really see-through at all, and translucent materials are not lit very consistently with the opaque stuff you use everywhere else. In my opinion, for swamp water, you should focus more on the look of the water and less on fancy effects like tessellation, refraction, and depth-based fades. Use vertex painting if you want to blend between two kinds of surfaces; it will look almost as good, especially if you use my displacement technique.

Anyways, those are just some thoughts from a materials vet. Hope they work out well for you; I would love to see what happens to the material!

Those are great comments fragfest, thanks for taking the time. It’s a bit tricky because the application I’m using this for requires a lot of flexibility at runtime for removal/adding of objects so I needed to use a dynamic solution vs relying on baked vertex painting. I’ll def take a look at your method of doing the displacement for sure. Nice shader and environment by the way, that’s impressive!

Alright, well best of luck to you! Glad you liked my scene!

That looks interesting keep it up Sir.

how is little nightmare 2 game swamp environment is created ?