Shader Graph14-upper limit, lower limit, rounding function

1. Open Unreal, create a new DemoCFR material, find Textures in StarterContent, find the distortion file, and drag it into the editing window.

Only select the R channel, connect it to Base Color, and only display the colors between 0 and 1. The results below correspond to Floor, Ceil, and Round from left to right. Floor means that the value of 0~1 is reduced to 0 so it is black, Ceil means that the value of 0~1 is increased to 1 so it is white, Round means that the value greater than 0.5 is increased to 1, and the value less than 0.5 is reduced to, so the display is black and white.

 2. The black and white tone of the ball

 First turn off the light and select Unlit, and cancel the display of the background Background.

Next, we simulate the direction of the light by ourselves at 0.5, 0.5, and 0.5, and VertexNormalWS is the surface normal direction, so that the brighter place with light is 1, and the darker place is -1.

Next we convert the value from -1~1 to the range of 0~1. In this way, the black-and-white transition is more natural. Some game engines use this kind of lighting half lambert. The surface in the direction of the incident light is brighter, and the surface in other directions is darker.

3. The version of Unity, basically

Guess you like

Origin blog.csdn.net/zhuziying99/article/details/130485188