How to make a SKY GRADIENT shader! (Unity Tutorial 🇬🇧)

Ғылым және технология

#unity #unity3d #gamedev #shaders #shadergraph #gradient
Let's have a look at how to use Unity's node-based shader editor, the Shader Graph, to create a simple URP gradient effect for a sky background with some easy-to-customise colours, and even a bit of bloom! :)
00:00 - Introduction
00:20 - Credits
00:30 - Setting up our project
01:32 - Creating the shader
03:01 - Making the effect
05:34 - Using HDR colors
07:07 - Conclusion

Пікірлер: 14

  • @Justin-hi6ln
    @Justin-hi6ln24 күн бұрын

    You might also try replacing the model UVs with world space UVs. That way your gradient can be tied to the scene and have a consistent direction regardless of the model orientation

  • @bennet615
    @bennet6158 күн бұрын

    thanks for tutorial , you have pretty cool voice !!

  • @mehmetakyuz5290
    @mehmetakyuz5290 Жыл бұрын

    Thank you very much! It was pretty smooth to go with

  • @minapecheux

    @minapecheux

    Жыл бұрын

    Thanks, I'm really happy you liked it! :)

  • @jeongmr.1641
    @jeongmr.16417 ай бұрын

    Such a nice tutorial thankyou very much!!

  • @minapecheux

    @minapecheux

    7 ай бұрын

    You're very welcome, I'm glad it was helpful! :)

  • @impulsegames338
    @impulsegames338 Жыл бұрын

    Awesome tutorial, incidentally stumbled upon it and it turns out it helped with something else I was working on. I was wondering though if it were possible with your set up to add a 3rd color?

  • @minapecheux

    @minapecheux

    Жыл бұрын

    Thanks for the nice comment, I'm glad it helped! :) So as is, this system wouldn't handle a 3rd colour "easily" - you'd basically to create 3 Lerp nodes (1 for the bottom-to-middle, another for the middle-to-top, and a third one to re-lerp those two). In that case, an easier solution might be to use a Sample Gradient node, and pass it the Y (G) coordinate of the Split node; this basically allows you to define a gradient inside the shader, and then have this shader be sampled according to the vertical position; and this gradient could contain as many colour points as you'd like! The reason I didn't use it here is because gradients cannot be edited in the inspector (that's a big issue the community isn't too happy about ^^) - so you can't easily change the colours from outside the shader. Hope it helps, cheers! :)

  • @impulsegames338

    @impulsegames338

    Жыл бұрын

    @@minapecheux All of this makes sense. I appreciate the response, I will try out both methods to see which is the best case for least inconvenience. Thanks!

  • @samsara2024
    @samsara2024 Жыл бұрын

    Any tutorial how to do a Sky shader + volumetric clouds from C# and HLSL code? thanks

  • @minapecheux

    @minapecheux

    Жыл бұрын

    I'm actually currently working on an ebook about Unity shaders that will include this example, among many others! But that's a great idea for a video, too, so I'll be sure to keep it in the back of my mind ;) Cheers,

  • @cybertech1076
    @cybertech107611 ай бұрын

    How to I make this as my skybox

  • @minapecheux

    @minapecheux

    11 ай бұрын

    Heya! From what I know, in a URP project, you can use any unlit shader as a skybox material - just create a new material from the shader, then go to the Lighting panel and, in the Environment tab, set your material as the Skybox Material :) That being said, I haven't tried this shader as a skybox, so I'm not exactly sure how the gradient is going to react, whether it's going to fit the horizon in some way... Hope it helps, though - cheers! :)

  • @tuomoluukkanen7265

    @tuomoluukkanen7265

    29 күн бұрын

    @@minapecheux I'm sorry, but this doesn't feel like it's a very complete tutorial on "sky gradient", if it leaves a giant hole between making a simple gradient, and actually applying it into something that could be used as a background. The only thing I can think of is to put it on its own layer, and have another camera render it solely in the background. Even then it doesn't adjust to different aspect ratios. This isn't a "sky gradient" shader.

Келесі