Unreal Materials : Clamp, Lerp and If - Unreal Material Course #3
Vložit
- čas přidán 19. 05. 2024
- In this series we'll go over all the important info you need to know to properly get started with unreal engine's material system!
Watch the full course here on patreon : / unreal-engine-103568300
Or here for youtube members : • Unreal Materials FULL ...
Join the discord for any help you need! : / discord
Join this channel to get access to perks:
/ @thegamedevcave
support the channel and development over on patreon : / thegamingcaves
Get personalized Coaching : www.fiverr.com/s/2P9GaN - Věda a technologie
Also, "New Reroute Declaration Nodes" can really help keeping the looks and logic of the materials clean and simple. Because just as you mentioned materials can get really really bulky and a mess, super fast. Reroute nodes are really a game changer (for me at least).
for sure! collapsing some node sections down into material functions (especially if they are reused of course) is also a massive help to keep things at a reasonable scale :)
It's important to note that saturate is better for performance over clamping between 0 and 1.
Yup! Good point, it is technically cheaper. I would personally not worry about it a lot, its unlikely to cause a noticable difference but best to get into the good habbit of using saturate then possible!
This is exactly what I wanted to comment, thanks.
Great video, Important thing to practise is to Saturate before lerping since Lerp alpha is 0-1 & saturate clamps to 0-1. Do you always need to saturate before lerping, No, But should you, Yes. I've been avoiding that If node since I figured out you can divide by 0 using it *Long story - Blob shadows*, But I think that is what i need to go back to instead of lerping for my landscape master material going off your example it should work quite well, other way I was going to try was DitherAA, still might with the IF.
yeah using a saturate node will ensure some more safety before a lerp. you probably should always try to put one in to be sure IF there any any chance of a value going over 1 or under 0. if youre just hooking up a texture, or just doing division for instance, there isn't really anything a saturate node will do since you'll always be between 0 and 1 anyway. Does it hurt adding a saturate node anyway? not really, it's such a cheap operation that adding a few more than needed is fine but it's also important to keep in mind why we do things instead of just doing them "because that's how you do it" I'd say.
Also, fun fact : lerp alpha is usually used for 0-1 values but it very much can go beyond a value of 1 and extrapolate from there with the same intervals as between 0-1 (which is why you saturate it, to make sure it doesn't go beyond 1) but sometimes it can be useful to just set a range of 0-1 and plug in other values to it. Limited usefulness for sure, but interesting