OCEAN shader with Unity Shader Graph!

preview_player
Показать описание
Hello and welcome to, like, the 10 millionth water tutorial I’ve done. In this week’s video we’re looking at some more in-depth Unity Shader Graph features to make water, or an ocean, with shoreline/edge foam, depth, and waves.

Shader is compatible with HDRP., *Edit*: it used to be compatible with LWRP but Unity changed something. I'll update this if it gets fixed!

I'm using some pretty basic audio tweaks inside Premiere Pro for this video, so let me know if things sound a little off. I'm looking for suggestions on decent Audio Interfaces if anyone is knowledgeable.

Once more I’d like to give a big shoutout to AE Tuts, go check him out here:

AE Tuts Intersect Material with Shader Graph::

My old Shader Graph water tutorial:

My Amplify Shader Editor ocean tutorial (with more features)

Link to the Normal Map that I use here:
(You'll need to convert it to a normal map inside Unity, as it's a greyscale image)

● Music by Francis Preve
Рекомендации по теме
Комментарии
Автор

Making such shader is freaking rocket science. This one is probably more sophisticated than the game I'm creating lol.
That being said, thanks for putting the effort in making this tutorial, because now I have an amazing water tile (repeatable!!) which I couldn't find in asset store.

Also hi-five to you commenters, because you solved a couple of problems that were encountered!

Dedemonn
Автор

For whoever is having issues with the specular parts on the 2019.3 version, mouse over the "PBR Master" node and click the cogwell for the options, then change the "Surface" type from "Opaque" to "Transparent". Also, on the Clamp, increase the maximum value so that it doesn't get obfuscated by your scene's lights.

MatheusPratta
Автор

First off, great tutorial. This was my very first introduction to Shader Graph, and I'm loving it. Thank you.


Second, for anyone curious, apply the scene depth cluster to the alpha channel, instead of the emissions channel. This will create a beautiful alpha transition for the water and any objects in or under it will still show the object textures/color. it will also cause a wonderful water-murky look the deeper the object moves from the surface. Obviously this is a bit more involved than I lead on, but hopefully will help someone.

Designbyapro
Автор

This is incredible for someone like me who does not know 3D Math and 3D Graphics well. These effects look realistic so fast and with just one effect of adding normals. The waves look amazing. It is quite hard to understand what's going on though. I neeeded to search for answers a lot.

romantroshkin
Автор

For those having problems with the foam what fixed it for me was lowering all the inputs of the shader to values between 0 and 2, that way i could make the foam work in Unity 2019.4.1 Thanks for the tutorial, i really learned a lot

Miroba
Автор

At first i couldn't achieve the same result as the video, for everyone using LWRP on Unity 2019.3.3f1 i had to set on the shadergraph's master node from opaque to trasparent, on the LWRP asset check the box "Depth Texture" and try to play a little with foam distance and strenght. Anyway bigup for the tutorial, it helped a lot <3

alkavyrus
Автор

I like the way your voice is. Its clear, Magic and travel with me in my knowledge journey

JMMedinaDev
Автор

actually 28:22 there's no need to multiply Linear01 scene depth by cam's far plane. change the sampling Mode of Scene Depth to Eye will do the same thing

rinsofia
Автор

Thanks for the tutorial! I also faced the problem with a foam. The decision helped me was to reduce the plane. The texture I used stretched to the full plane, and there was a black part next to the object, so nothing was visible. Reducing the plane by 3-4 times saved the situation.

Гаррошвбикини
Автор

I do love your tutorials but I do have a constructive criticism if you'll indulge me. My only recommendation would be to slow way down during each step so we can see what you're clicking on (for example when making the very first pbr shader), it was extremely hard to see what you clicked without pausing at just the right moment during a few moments in the video. Overall though, I'm extremely grateful for you taking the time to make this and share your knowledge. Thank you, definitely getting another thumbs up!

MiddleCross
Автор

If your water is not moving try turning on "Animated materials" in the scene view

emergencyDuck
Автор

14:39 I think you could also use a one minus node and take the first timer as it's input. It's less clutter than another timer.

Xyte
Автор

I have fixed the foam problem! I changed the settings of the LightWeightRenderPipeline -> General -> Depth Texture (check this). After I checked it, in Game Mode, everything was back to normal. Yay

Ineshi
Автор

It still works Perfectly. You Saved My Life. 👍

루루우-jm
Автор

great tutorial, learned a lot from you and having self conversations with urself in between the tutorial made my day :) Thanks a lot

altugozhan
Автор

A very cool tutorial, I edited & fixed some issues with the recent versions of HDRP but that helped me a lot to understand how it work !

Krhos
Автор

FOR ANYONE WHO WAS HAVING ISSUES NOT SEEING FOAM. THE ISSUE IS IN YOUR LIGHTING/SCENE RENDERING AND POST PROCESSING SETTINGS. IF YOU LEFT ALL THE SETTINGS AT DEFAULTS IT CAUSES THE FOAM TO NOT BE THERE. if you go into post processing volume settings and disable EXPOSURE then go to your volume settings to your sky settings and also disable EXPOSURE . then go to your directional light settings and change the lux from to 10, this will fix your issue

sinprosmusic
Автор

Nice. Combining this with a tutorial on spherical water to see if I can make good water for planets.

panickal
Автор

I ran into problems as well here. What worked for me is to set the depth node to Eye space and remove the camera node, then link this to the A slot of the subtract node. Another thing you can do is replace the clamp with the smoothstep node to get a smoother transition (works very well for the object depth) though control is a little more limited from what I'm experiencing

Also: Remember to set the PBR node to transparent, forgot this and nothing seemed to work and caused a major headache hahaha

alexvandenberg
Автор

I'm still watching. I am at 10:13. The offset is basicly an add operation on the UVs

KDSBestGameDev
join shbcf.ru