I just created a simple modification to the URP 3D SkeletonLit shader with a toggle to enable Lit From Behind. It's rather simple, as it's just the absolute value of the dot product abs(dot(lightdir, normal)) is used instead of the dot product.
half3 LightingLambertLitFromBehind(half3 lightColor, half3 lightDir, half3 normal)
{
half NdotL = saturate(abs(dot(normal, lightDir)));
return lightColor * NdotL;
}
#ifdef _LIT_FROM_BEHIND
#define LightingLambert LightingLambertLitFromBehind
#else
#define LightingLambert LightingLambert
#endif
com.esotericsoftware.spine.urp-shaders-SkeletonLitFromBehind.zip
It's just a simple solution here.
While editing the Sprite shader as well I noticed that the result is rather unintuitive since a normalmap would then be strangely lit here. Anyway, I included it in the zip package below with the required file-overrides. For the Sprite shader you will need to switch Inspector to debug mode and add _LIT_FROM_BEHIND to the shader keywords to enable it, since the GUI code would otherwise need to be modified as well.
Harald schriebToggling Advanced - Add Normals or Advanced - Solve Tangents along with Fixed Normals did not manage to solve the issue of the lighting only effecting assets focused around where the X-axis equals 0.
Do you still need this given the lit-from-behind functionality?
If yes, please post a screenshot of the problem.
Harald schriebActually... 😐 are there resources for where I can find how to attach Normals and Emission Maps?
What exactly do you have problems with? You create normal and emission maps in the editor of your choice based on the normal atlas texture (with Photoshop, Substance Alchemist, etc.) and assign the textures to the slot in the Material Inspector.
I forgot to mention this above: I decided against adding the Lit From Behind feature officially since it's a very narrow use case. What will be added is an option for lighting the back-face at the SkeletonLit shader, a parameter Double Sided Lighting.
Harald schriebWhat will be added is an option for lighting the back-face at the SkeletonLit shader, a parameter Double Sided Lighting.
This feature has just been completed, all SkeletonLit shaders now provide a Double Sided Lighting parameter to properly light the back-face as well.
New 3.8 spine-unity, URP and LWRP packages are available for download here as usual:
Spine Unity Download: Download