Hi, I really like the character you are working on. I wanted to ask you how do you achieve that cool pixelated effect on the textures?
Hi @ilsagace thanks for asking! Sorry for the super late response, I’m still catching up to messages.
I’m not sure whether you are referring to the crisp shapes on the textures or the fake lighting shader so I’ll do my best to briefly go over both, but please do ask for more clarification if you need it.
Because my textures are all flat shapes and were either drawn out straight with the lasso tool or filled in over and over while trying to figure out the palette they ended up with pretty sharp lines. The actual full resolution before scaling down looks like this:
Then when bringing the diffuse into Unity the import settings are switched to “point” in the filter mode, which turns off any automatic smoothing Unity will try to do for you. In addition you can switch off mipmaps if you need something to still register as crisp from a distance (and there aren’t too many objects in too large a scene).
If making textures more pixelated is your thing, point filter mode will continue to solve that for you. Excuse the messy results, but I scaled down the diffuse map here at a couple of sizes as an example (using both nearest neighbour and bilinear resampling).
The results below are to show the difference the point filter mode makes and look pretty dirty, but if you were going to make pixel textures by hand I think with purposeful texturing and some carefully aligned UVs on a model it would make for a nicely clean and attractive result.
If its the lighting shader you wanted to know about, it’s like a ramp shader at its base, taking the information on how to overlay a texture over the main diffuse.
I’m still pretty new to shaders and don’t want to risk giving incorrect information but there’s a lot of information on using ramps out there and Unity provides an example script here.
The layers of shadows, or the “cel shading look” is achieved by making ramps that are themselves made up of sharp blocks of colour:
Last thing I can think to note is to remember to take light attenuation into account if you are using a scene with multiple lights and need the distance of the light from the material to have an impact. In my scene I’ve currently only got a single directional light so don’t feel I need to bother with it just yet.