Single Layer Water | 5-Minute Materials [UE4/UE5] — Transcript
Full transcript
- 0:00[Music]
- 0:05[Music]
- 0:11hello and welcome back to five minute
- 0:13materials the show where we demystify
- 0:14every node in the unreal engine material
- 0:16graph today
- 0:18we're looking at the single layer water
- 0:20shader model so
- 0:23the first thing that we're going to do
- 0:25is we're actually going to disable my
- 0:27cell shader post processing um because
- 0:31you know not everyone is using a global
- 0:33cell shader so we're going to do this
- 0:35from a regular person's perspective so
- 0:39the single layer water node let's just
- 0:41create a plane which is going to
- 0:43simulate our water and we're going to
- 0:46create a new material apply that to this
- 0:49so the first thing we do in order to
- 0:51enable the
- 0:52single layer water
- 0:54stuff
- 0:55is we're going to go to its shading
- 0:57model and instead of default lit we're
- 0:58going to go all the way down the bottom
- 1:00and click single layer water
- 1:02now you're going to be greeted with an
- 1:04error straight away that is to be
- 1:06expected so what we're going to do is go
- 1:08single layer water material output now
- 1:10this i'd probably just sit it underneath
- 1:12your regular material output stuff now
- 1:16let's just get some
- 1:17stuff going if we just put zero in the
- 1:20base color we're gonna put zero in the
- 1:21opacity
- 1:23um we'll put
- 1:25one in the refraction uh if we actually
- 1:28just put zero in the absorption or
- 1:30something so we've created a a flat
- 1:33plane of nothingness
- 1:36what we're going to do now is create a
- 1:38parameter this is going to be called our
- 1:41water
- 1:42absorption
- 1:44absorption value after this we're going
- 1:48to add a
- 1:49multiply
- 1:51uh we're going to call this the water
- 1:54murkiness i guess is a good a good
- 1:57way to think about it
- 1:59uh and then after this we're gonna just
- 2:00divide it by a hundred and the reason
- 2:02we're dividing it by 100 is because this
- 2:05has to be a really small number and it
- 2:07can just be a real penis in the anus to
- 2:09work with small numbers um with
- 2:12parameters and stuff so what we're going
- 2:14to do we're just going to chuck that
- 2:15into the absorption coefficient and
- 2:17we're going to select a slightly red
- 2:20color here now because this is like
- 2:21based on physicalness and stuff this is
- 2:24actually saying which wavelengths of
- 2:27light do we want to absorb in the water
- 2:30so the color will end up being the
- 2:32opposite of this one now you can see
- 2:35we've already got something that looks
- 2:37kind of half decent and if we move this
- 2:39up you can see that the deeper something
- 2:41is
- 2:42the more
- 2:43red light it's going to absorb so if
- 2:46it's very shallow it's going to look
- 2:47like this if it's up here it's going to
- 2:49look like that
- 2:50our murkiness parameter can adjust sort
- 2:53of the
- 2:54strength of that
- 2:55um so if we kind of put it right here
- 2:58where we've got this like nice rock and
- 3:00put the murkiness all the way up then
- 3:02you can see that you know it's doing
- 3:04something uh go team
- 3:06now this might be all that you need for
- 3:09your water you might only need to use
- 3:11absorption coefficient um there is the
- 3:14scattering coefficient which is very
- 3:16similar so we've now got water
- 3:18scattering set up and that's just going
- 3:20into the water scattering coefficients
- 3:22thingamajig uh we can change the color
- 3:25of this to you know blue or something
- 3:28and then adjust the
- 3:30intensity of it now this kind of
- 3:33i mean you can kind of see what it's
- 3:35doing it's uh it's scattering the light
- 3:38um
- 3:40underneath the surface and obviously we
- 3:42don't want that too strong
- 3:45but
- 3:47you know a lot of the time you might not
- 3:49need this it's it's kind of an extra
- 3:52step uh you can kind of see what it's
- 3:54doing here with the shadow a lot of this
- 3:56is just you know experiment with it
- 3:58yourself see what you can come up with
- 4:00hopefully i've just given you the the
- 4:02tools needed to start you know messing
- 4:05around with it now there are some other
- 4:08bits here there's the phase g which
- 4:10takes a negative one to one value
- 4:13um i've never touched this i'm guessing
- 4:15that the phase g input has something to
- 4:18do with kind of creating like chromatic
- 4:20aberration
- 4:21uh like you know the the direction of
- 4:24the scattering that's going on
- 4:26um and then the color scale behind water
- 4:29uh basically this is used for things
- 4:31like uh caustics and stuff caught core
- 4:35sticks caustics
- 4:37um so we just pump this up a little bit
- 4:40and you'll see that yeah it's kind of
- 4:41lightening everything
- 4:44behind the water um you might have to
- 4:46use some like bump offset or something
- 4:48in order to get this looking nice and
- 4:50obviously you'd want to you know animate
- 4:51this and blah blah but for now we're
- 4:53going to ignore that
- 4:55if you do leave this blank and these two
- 4:58blank your instruction count will be
- 5:00lower then you can see we jump from 535
- 5:03to 552 instructions so
- 5:06you do save a little bit of juice by
- 5:08keeping them at zero um
- 5:10for stylized water this is basically all
- 5:13that you would probably maybe need so
- 5:16that's kind of what it does do the
- 5:18single layer water side of things you
- 5:20know the absorption and the blah blah
- 5:22those nodes they basically replace the
- 5:24depth fade that you'd be using on like a
- 5:26translucent material but one of the
- 5:28advantages of this is that this is
- 5:30actually an opaque material it's doing a
- 5:32separate pass
- 5:34that renders
- 5:35underneath
- 5:36um and then i guess it kind of projects
- 5:39it onto the top layer so now i guess
- 5:41what we're going to do is we're going to
- 5:43run over what the other
- 5:45inputs can be used for for things like
- 5:48you know water for example the color up
- 5:51here isn't really gonna change much you
- 5:53know if i put this to one
- 5:55it hasn't actually changed anything and
- 5:57that's because our opacity is at zero so
- 6:00if we got a texture
- 6:02uh and it was like cloud or something
- 6:06and
- 6:06let's run it through like a contrast
- 6:09and we're gonna put one into that
- 6:11maybe two into the contrast and then we
- 6:13put that into the opacity
- 6:15then some parts of this are gonna be
- 6:18zero opacity and other parts are gonna
- 6:21be one opacity let's actually put this
- 6:23up a little bit higher so this is what
- 6:25you'd be using for something like foam
- 6:27foam on the water
- 6:31the
- 6:32refraction it actually works a little
- 6:35bit weirdly i found that 1.033
- 6:40is a good refraction index to kind of
- 6:43start with even though
- 6:451.33 would be more appropriate for
- 6:47something like water and so the
- 6:48refraction interacts with the normal
- 6:52uh
- 6:53input output as usual
- 6:55let's just grab a
- 6:57water
- 6:59normal map
- 7:00there we go let's grab another one
- 7:03let's grab a panna
- 7:05let's put that in there and this in
- 7:08there
- 7:09and we'll make this one go 0.1 and this
- 7:12one 0.01 in the other thing we're gonna
- 7:16grab text codes
- 7:18pump that into one of them and just make
- 7:19this one like 1.73 times
- 7:22smaller uh now i just compiled that
- 7:25without actually plugging these in so
- 7:26we're going to go blend angle corrected
- 7:28normals and we'll blend these two
- 7:30together and now we're just going to
- 7:32chuck that into the normal
- 7:34[Music]
- 7:35cool you can see we have some
- 7:38you know waviness
- 7:40um if i had put this up higher like 1.33
- 7:45then it kind of looks a bit crazy i mean
- 7:47maybe that is correct but
- 7:49it's just
- 7:51it's just not as nice looking
- 7:53i'm going to get rid of this color and
- 7:55stuff as well because it's really
- 7:57annoying me we'll put zero in the
- 7:59opacity
- 8:00uh so one last little tip that i have is
- 8:02if you're doing anything like world
- 8:04position offset to make you know ripples
- 8:07appear around here and stuff well
- 8:09position offset isn't actually going to
- 8:10affect the normals so what you can do is
- 8:13a little hacky method if we were doing
- 8:15something like distance to
- 8:17near a surface if we wanted to do
- 8:19something like shore ripples
- 8:22um you can actually just add to the
- 8:25refraction index um to kind of fake
- 8:29these ripples having bumps obviously
- 8:31like these don't actually have any any
- 8:33bumpiness
- 8:34but you know it obviously gives the
- 8:36effect if it was a little bit slower
- 8:39yeah damn
- 8:40uh five to four times slower so you can
- 8:43see now that it kind of looks like this
- 8:45is uh
- 8:46doing that thing
- 8:48that everyone likes
- 8:50so that is the single layer water node a
- 8:54very quick rough explanation hopefully
- 8:57that's enough to get you started
- 8:58using it um it can seem very convoluted
- 9:02at first but hopefully this kind of
- 9:04gave you some ideas of you know how it
- 9:06can be used so just as a little example
- 9:09of what we can do with this shader model
- 9:11um here i've got some clear
- 9:14i guess lake water pond water it's got
- 9:17this algae stuff on top of it and you
- 9:19know i can skim that off
- 9:21this is all a part of my landscape
- 9:23interaction system and whatnot so this
- 9:25algae is
- 9:26full opacity the water is zero opacity
- 9:30i've got these ripples around you know
- 9:32distance fields and that kind of stuff
- 9:34if you want to know how to do this thing
- 9:35with the distance fields a bit better
- 9:37check out this tutorial here in which i
- 9:39explain how distance fields can be used
- 9:43um
- 9:44and yeah we've got this foam that you
- 9:46know
- 9:48appears when the when the player moves
- 9:49and that kind of stuff if we go to this
- 9:52level here
- 9:54uh you can see that i've actually set up
- 9:55some proper waves and stuff and i've got
- 9:58these nice foam trails that are all a
- 10:00part of my um
- 10:01my interaction system and that kind of
- 10:03stuff
- 10:04um
- 10:06and you know same thing as the character
- 10:08moves through we get these ripples we
- 10:10get some foam that the character creates
- 10:12and yeah this is all made pretty easy i
- 10:15mean i say pretty easy it took me like
- 10:17two solid days of work you know it's
- 10:19it's it's made a lot simpler with the
- 10:21single layer water shader model um
- 10:25it's a lot easier to get a nice looking
- 10:27result basically so i hope that you
- 10:30found this video educational and or
- 10:32entertaining
- 10:34and if you do want to find out more
- 10:37about you know how any of my water
- 10:39systems in particular work feel free to
- 10:41join our twitch streams which happen
- 10:44most days of the week so you can ask
- 10:46questions live there
- 10:48and
- 10:49that kind of thing if you run into any
- 10:51kind of problems with you know single
- 10:53layer water node and whatnot and you
- 10:55need to ask me something feel free to do
- 10:57so in our discord which is always linked
- 10:59below and if you do want to go one step
- 11:01further in supporting these tutorials
- 11:03and the rest of this channel and the
- 11:04development of this game
- 11:06then you can do so at our patreon which
- 11:08is linked below for as little as one
- 11:11dollar per month so i guess with that
- 11:14we say goodbye
- 11:18goodbye
- 11:28um
- 11:53you
About this transcript
This page contains the full transcript of Single Layer Water | 5-Minute Materials [UE4/UE5] by PrismaticaDev, generated from the public captions YouTube serves with the video. The transcript has 1,907 words across 306 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.