【Ramptexture]
Ramptexture (gradient texture), which can be 1D/2D texture.
This allows you to accentuate the surface's colors to fake the effects of more bounce light or a more advanced lighting setup. you see this technique used a lot more for cartoony games, where you need a more artist-driven look to your shaders and not so much of a physically-accurate lighting model.
First, you need a gradient texture:
Based on half Lambert, use ramptexture to control diffuse shading:
The following is the result you will see after running the Code:
【How it works]
We take the re-mapped diffuse values from the half Lambert operation and pass them into float2 () to create the lookup values for the texture. when a value of 0 is set as the hlambert variable, the tex2d function looks up the pixel value at the UV value of (0, 0 ). in this case it's the subtle peach color from the ramps gradient. when a value of 1 is set for the hlambert variable, the tex2d function looks up the pixel at the UV value of (1, 1), or the white color.
Use ramptexture to control diffuse Shading