This is such a nice technique, not hard to get it right and can yield some interesting results. 👍 Btw, learn more about VFX for Games with this course: www.udemy.com/course/unity-vfx-graph-thunderlord-magic-effects/?couponCode=29.99_UNTIL_20-09
Excellent tutorial. Goes well with my game. Though I was facing one small issue which was that from the game view (FP view) the clouds directly at the centre of the view were always darker than the clouds outside the centre. There was always this darker to light gradient from the centre to outwards. My hunch is that since the material type is Lit a shadow was forming on the centre view which makes sense because from the point of the player there should be shadow there since it is a mesh object. Disabling the shadow of the cloud mesh did not solve the problem for me. Fortunately I fixed this issue by changing material type from Lit to Unlit in the Graph Settings in the shader and now it is working perfectly as expected with no dark to light gradient being formed. :) Just wanted to share my solution if anyone happen to come across the same issue as mine. Take care and again an awesome tutorial. Keep it up! :) K Out!
great tutorial, really liked how in the first few minutes when you showed using the noise I could see the effect I was looking for. In some other shader graph videos the person takes a long time for the effect to be shown, but you showed it at each step so you could stop where you like.
9:38 we see the low-lying clouds clipping through the mountains. it would be cool to see how to make them fade out right around objects. I've seen beach water tutorials that add a seafoam rim around water. if that can work, the same principle can be applied here, using a depth test, I think, to make the clouds never "cut" through objects. would be a nice upgrade. also, it would be cool to see how to set up a plane above the player that is positioned above them each frame, yet is set to use world coordinates so the cloud layers move as it should.
Great clouds. For anyone disgruntled about the low resolution, you can apply some simple maths to create a crude fractal noise subgraph using tiling nodes and the simple noise node.
0:00 this gives me real Goldeneye 64 vibes. makes me want to work on my own goldeneye game. there's already two coming out: Agent 64, and also S.P.I.E.S, but I want to make my own, and these clouds would be perfect.
the only thing I want to change is that in the distance, the clouds become dark instead of staying white. probably because it's affected by the fog color? i wonder if there's a way to make it use the sky color. Also, I set the cloud shader to additive mode and to where they do not cast shadows - I plan to make my landscape shader have the shadows built-in, like how Genshin Impact does it, which would be super performant over shadows. this tutorial is great for cirrus and stratus clouds. but now we need to figure out how to make the poofy cumulus and nimbus clouds!
@@esmanuryldrm285 ah yes I'm sure I must have or I'd be constantly annoyed. ... checking my project, I settled on the procedural sky shader by Digvijaysinh Gohil, with another cloud plane above the world with its own shader. checking further, while my skybox is the Digvijaysinh Gohil one, my clouds shader is called Clouds of Aguiar, which means I AM using this shader without issues. I can't share a screenshot, but I can share settings. Surface Input: CloudCOlor: white Scale_LayerA: 111 Scale_LayerB: 111 Scale_LayerC: 555 Speed_LayerA: x: 0.01, y: 0.005 Speed_LayerB: x: -0.001, y: -0.0005 CloudPower: 0.62 CloudAlpha: 4.21 Fresnel Power: 1.14 Max Brightness: 1 Alpha Clip: 0 My cloud plane in my scene is not actually a plane but a very wide flat bowl that curves upward toward the edges, since the alpha blend is based on a fresnel curvature, and this way you never see a sharp edge with my settings. the "CloudPlane" in my blend file is 18000m by 18000 wide by 448.821 m high to give an idea, exported as an fbx another cool benefit of my settings is that as your character moves upward toward the clouds, the clouds appear to dissolve, so you never have a harsh clip through the plane, if you cross through it. the cloud plane is in my scene and tracks is itself with the player's movement each frame just like the sun and moon object, so they never appear distorted from the camera perpective. All this means my clouds never touch the low horizon, and I'm considering adding a second cloud cylinder that also tracks the player position, just to have "low on the horizon clouds." I can't see a full graph of what he made in the video, but I think my adding the fresnel to the Alpha channel could be it (Fresnel Power, Power a and b, into Fresnel Effect Power, into One Minus, into the b of two multiply nodes connected to final noise texture mix, then into the Alpha of Fragment.) right before these two multiply nodes on the other track is multiply with cloudAlpha as the B, and the CloudPower Power node right before it, that splits upward toward the tiling and offset section. I hope this helps a bit. If this does help let me know. To see it all in action, one of my most recent long videos showcases me walking around my jungle area, and the sky is this, changing per time of day. i use the wind waker method of having tables of colors per time of day and weather condition, and the materials for the sky, fog, clouds, and environment lerp between those color sets depending on the TimeProgression time. PS. this grey issue in his vid seems to be the fog color affecting the cloud plane. there's a small chance I was able to disable 'affect by fog' somewhere in the shader, but I don't know how I'd set that since it's shader graph, unless i added this material to the URP settings and told it to ignore fog, but I'm not sure if that's possible.
here's another comment I have on this video as well: Don't like the hard edge far away on a cloud plane? I added a fresnel effect so I can make the hard edge of the cloud plane in the distance, fade off, making it look flawless: Fresnel Power float goes into both of a Power node's inputs. The power node goes into the Power input of a Fresnel Effect node. then I send it into a One Minus node to flip it otherwise it keeps the far edges but make the clouds above you invisible - the opposite of the desired effect. Then I multiply the one minus node with the final result of our Alpha blended parts, then I multiply the result again with the one minus node. then send THAT into the alpha channel of the node. adjust the Fresnel Power in the inspector to about 2.16 - or set that to the default value, and boom. no more hard edge. WARNING: i could not get the AlphaClip to look nice with the fresnel. I'm sure it's must be possible, though. the normal transparency works great though. it has the added benefit that as you raise the player up near the cloud layer, is smoothly fades out, reducing the harsh SNAP appearance when you cross through it. in lots of games 2d planar light based things like god rays through a window, will fade out as you approach, to prevent clipping appearances. you can use a similar fresnel effect on an ocean shader to make the water clearer/less reflective directly below you, or even more greenish, which is realistic in my real life experience, depending on the waters.
Thank you for the tutorial, is there any way to control shadows casting from the clouds to plane because rn it is casting very sharp and dark shadows preventing to see materials when covered in shadows?
@@toehtetpotatoe7549 nah, we did play around with the URP settings on shadows but we just used the cloud as set piece and have it not cast shadows since it was difficult to see the environment and enemies.
you could try to make the uvs relative to absolute world position , so the texture drawn will move depending on the position of the plane , this trick is useful in making seamless tiling between objects of the same material
Hey Gabriel, Awesome tutorial man, Can you please share how to use GPU instancing with materials that uses shaders made using shader graphs, if you know. I am really struggling to make it work.
You can make it use GPU Instancing but you need to make it not SRP Batcher compatible. Unity shows you how here: docs.unity3d.com/Manual/SRPBatcher.html#intentionally-removing-compatibility
Thank you for this tutorial, I managed to use this shader so I can get cloud shadows in my 2D game. One question tho , is there a way to make the clouds (shadows in my case )edges less sharp ( more blurry ? )
Don't like the hard edge far away on a cloud plane? I added a fresnel effect so I can make the hard edge of the cloud plane in the distance, fade off, making it look flawless: Fresnel Power float goes into both of a Power node's inputs. The power node goes into the Power input of a Fresnel Effect node. then I send it into a One Minus node to flip it otherwise it keeps the far edges but make the clouds above you invisible - the opposite of the desired effect. Then I multiply the one minus node with the final result of our Alpha blended parts, then I multiply the result again with the one minus node. then send THAT into the alpha channel of the node. adjust the Fresnel Power in the inspector to about 2.16 - or set that to the default value, and boom. no more hard edge. WARNING: i could not get the AlphaClip to look nice with the fresnel. I'm sure it's must be possible, though. the normal transparency works great though. it has the added benefit that as you raise the player up near the cloud layer, is smoothly fades out, reducing the harsh SNAP appearance when you cross through it. in lots of games 2d planar light based things like god rays through a window, will fade out as you approach, to prevent clipping appearances. you can use a similar fresnel effect on an ocean shader to make the water clearer/less reflective directly below you, or even more greenish, which is realistic in my real life experience, depending on the waters.
Hello, awesome tut! i put this to work in matter of minutes! but i have a problem, even scaling at 500 i can see in the distance the end of the plane and the skybox behind, any smart method to prevent that? :)
Well I would suggest turning on Fog, if possible. If not, in the shader you might need to use a mask. The mask would consist of white: visible, black or transparent: invisible. That mask would be a texture that is multiplied near the end of the shader.
@@GabrielAguiarProd hey there, i managed to make it work nicely by increasing the plane and setting the max distance of my procedural world to half the plane width/height. Working nicely Thank you!!! :)
How so? As long as you have Shader Graph you can recreate this in URP or HDRP. Start with a Lit Graph or Unlit Graph. If you are in the standard render pipeline you can steel use Amplify Shaders, the nodes are similar and the workflow/idea is the same. :)
Gabriel Aguiar Prod. Unfortunately, the shader gets bugged. The textures don't work right and when trying to adjust to less clouds, the textures get black and orange
the shader is working but it’s giving me warnings. pow(f, e) will not work for negative f. use abs(f) and so on. any solutions because i’ve never worked with shadergraphs that much
Make sure you are in the Universal Render Pipeline (URP). You can create a new project with Unity Hub and select URP as the template, it will make your life easier when following this tutorial. Hope this helps.
Can someone help me at 3:08 when he says to use universal I click that and save asset and my material stays pink. I also have another option for built in and when I use that target it works but I don't know if built in target is causing it but the clouds only move when I change the speed then they stop again.
What you want to achieve is WAY easier in HDRP. It has a built-in distortion effect that is very easy to use. I tried in URP, and while you can do some effects using the Scene Color node, the effects cannot stack and it's an enormous headache to setup.
@@GabrielAguiarProd what the difference between shader graph hdrp and standard one ... is it possible to create one shader and works automatically on both pipelines ?
@@TheBlackbirdii that is the whole point of shader graph ,tho standard (legacy pipeline) is a qustion still it will definetly work in hdrp and urp automaticaly if you use standard nodes