My game has this orthogonal JRPG view and I'm experimenting with lights and normal maps. I saw Graveyard Keeper did this z-depth / y-sort thing where if the Y value of a light source is less than the object, the light source isn't affecting the object, as described in this post : https://www.gamasutra.com/blogs/SvyatoslavCherkasov/20181023/329151/Graveyard_Keeper_How_the_graphics_effects_are_made.php
One of the built-ins for a 2D light shader is LIGHT_HEIGHT. A value of 32.0 works well for the front-lit case, but for the back-lit case 0 works well, with 8.0 giving nice light from a same y position setup. I figure I can use LIGHT_VEC, but that's the vector from light to the fragment, not the vector from light to the entire sprite. Also, what values does it have ? I did an if statement, where I change the color based on the y value being smaller than 0, which is anything on the south side of the circle around the light source it seems.
Does anyone have an idea on how to implement something like this?