AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() A value of 1 will give me mid-point blend, value of 2 - a 0.75 blend, etc, etc… You could achieve the same with range-mapping, but for my needs this is quite enough (I work with an artist who want to play with a slider) While there are many ways of achieving this, I would just multiply the UV value with the height value, which gives me good results. We are still missing the ‘height’ control we want.UVs are from 0 to 1, and go ‘bottom-to-top’ on a mesh.We will then also use the Alpha values of these colour. Again, in this example I want a sky gradient from black to purple. So, we will sample the colours and use the Lerp Node according to the UV value of our pixel. ![]() You can check here the great explenation and visualization by CodeMonkey. The property we’ll use for this is of course its UV values. Each pixel should get his colour based on his location across an axis (in this example - the Y axis, but you could use any axis). Now let’s think about how to colour each pixel. Exposing the values means we can animate it, change it through the material according to some other variables, environment, player settings, and everything you want. This parameter will give us control over the colours ‘blend point’. These are the properties I would expose - two colours to blend, and a ‘height’ parameter slider. I will just assume basic knowledge in Unity and URP/HDRP. ![]() There are plenty of tutorials online so I won't repeat the process here, unless I make a full Shader Graph series later on. Just a note before we begin - in order to write this shader you need to have the Shader Graph package already installed. ![]()
0 Comments
Read More
Leave a Reply. |