I've been trying to work out shaders for a couple of months now, in an attempt to render 3d scenes as 'pixel art'. Recently, I've tried my hand at incorporating ATTENUATION.
Its giving me a good bit of grief.
In editor, things seem okay-- in game its a different story. The shadows definitely appear, but not as I would be expecting them to.
Editor shadows:
In game:
I've tried to adjust the main light shadow settings, but nothing I try seems to get things to show up properly. These screenshots are taken with a default Directional Light, and default Project Settings (Rendering > Lights & Shadows).
Would anybody be able to help me determine what I'm doing wrong?
I'm also not 100% clear on how ATTENUATION works... Currently, I have the following light() function in my toon ramp shader:
The way I currently understand ATTENUATION is that it should be > 0.0 when an object is 'in the light'; Should it be < 0.0 when in shadow? Am I understanding this correctly? Ideally I'll be bumping the ramp down a step, clamped to the lowest step, when an object is shadowed-- That's certainly not what I'm doing now, though... Feel like I'd have an easier time working things out if I knew the range of values ATTENUATION was returning.