Загрузка видео...
Не удалось загрузить видео
Waterfall breakdown time! Been working on this waterfall material for the last few days, I want to share a few neat things and gotchas I found when working on it. It's not very complex of an effect, really just a few panning textures! 🧵1/n
510,032 просмотров • 2 лет назад •via X (Twitter)
Комментарии: 25

Firstly, the material uses the Thin Translucent shader model. This is because: 1) If we used normal translucent, when you make the material more translucent specular highlights fade away too (BAD!) For water we want BRIGHT highlights and transparent water, like this!

2) SLW doesn't like rendering multiple layers. If you have a waterfall, you gotta have a treasure chest behind it, and so when you look back through the waterfall at the ocean, if they are both SLW, the ocean looks BLACK. So Thin Translucent it is!

And also, make sure the translucent pass is set to "BEFORE DOF", this is needed to get our nice reflections from our waterfall! This is a bit odd still, as things break a bit if the waterfall doesn't have something (like rocks) writing depth right behind it, but.... good enough!

Ok so, material time! Really, it's just a few panning textures. Lets start with normals! Just using a waves normal map, and stretching it so it looks a bit streaky, which gives us those nice highlights. And then just scrolling it down!

If we turn down opacity (to make our mesh see through), and then turn on refraction (1.12, pixel normal offset, and metallic spec offset at 0.1, 1, 0.33) we already get something that looks SUPER watery! OoooOoO

FOAM TIME. I'm using these two foam textures, that are also just scrolling down. We can remap vertexColor.r from [0,1] to [-1,1], and ADD that to our foam mask to let use dissolve away foam.

This remap is important, bc if we just multiply the foam*vtxcolor.r the parts of the text that were black (no foam) could NEVER have any foam no matter how hard you painted it. Remap to -1,1 then adding means that we can have NO FOAM or SOLID foam with a nice noisey dissolve btwn

One important thing; If we just turn on refraction again, you'll see that our foam that should be ONTOP of the water, is also getting refracted and it looks GROSS. This is an easy fix, we just lerp the refraction amount based on the foam mask!

That is to say, anywhere there is FOAM, we want refraction to be 1 (which is no refraction), anywhere there isn't foam, we want refraction to be whatever the water refraction we set is (1.2ish). So just Lerp(a:waterRefraction, b:1, t:FoamMask)

Really now, it's just a case of layering on the foam with the water surface below and figuring out our final opacity based on these masks. We can plug in a color value to the "Thin Translucent Material Output" node to tint our water and make it look like blue gatorade or whatever

It's ez and just a few lerps though

THATS REALLY IT! You now have a cool waterfall! YAY But still have two super neat tricks that I think are cool that make the waterfall EVEN COOLER.

#1) Scale-based uvs. Instead of just using texcoords to sample the foam/normal textures, we can scale them up by the obj scale first, so that when we scale up the waterfall mesh, the textures don't get gross and stretched, but instead keep the same size! COOL HUH??

We can also get a "random" value from the object position and use that as a random offset to the texcoord too, so that every waterfall gets a little random offset so they look a little different and not all scrolling the exact same texture at the same time in the same place

#2) Is a bit more complex, but I really HATE that hard edge on the left and right sides of the waterfall. They are perfectly STRAIGHT. We need to break up that edge so it looks more organic. We could just fade it out with a vertex color painted on, but that's boring...

Instead, lets paint an opacity mask (in vtxcolor.a) and then use that, just like we did with the foam, as a dissolve! We'll only use the foam coming from the splashy looking texture, and if we sharpen up that mask we get some REALLY nice splashes on the edges now too!

Plugging that into opacity, looks so good!! Those gross hard straight edges are now splashy beautiful edges!

The one issue with this, now that we have parts of the waterfall we want to cut away entirely, if we just plug it into opacity, those cut away bits are still getting specular highlights (and refractions, and wpo)! GROSS!! We can fix this though :)

We just have to use this opacity mask in a lerp, to lerp metallic, spec, and roughness down to 0 on pixels that are cut away (value of 0, black, on the opacity mask). We also want to lerp refraction down to 1 in these spots, and scale down the wpo intensity here too!

Oh, I didn't talk about WPO! It's straightforward! Using the built-in "Low Res Blurred Noise", we just visually find some nice values for the uv scale, and scroll speed, and then push each vertex towards it's normal direction, scaled by the noise*intensity!

If you want your waterfall to be two-sided, remember to flip the normal.z based on the twosidedsign node!

Graph

DM_Mul2Sub1 is just the remap from [0,1] to [-1,1]. Just does exactly what it says, multiplies the input by 2, then subtracts 1.

THE END THANKS FOR COMING TO MY TED TALK! Always happy to answer questions or explain something more, just ask! I'm gunna go drink some blue gatorade now as looking at this waterfall made me THIRSTY

There's also a youtube thingy, doesn't quite go in as much detail as this thread, but might be usefuly. Mostly me just rambling, so watch at 2x speed!
Похожие видео
Sensitive content
•Animation - Killjoy getting her mind reset. I loved animating this! It's kind of short but I've been working on this for a few days between breaks and I'm glad I finally finished it! #hypnosis #mindcontrol #hypnokink #hypnoart
HypnoGurl💛 •CLOSED COMMISSIONS•
35,054 просмотров • 1 год назад
