I've been losing my mind over this for a couple of days now, and can't find any concrete information about it.
I am trying to write a custom shader (shader graph to be specific) to light sprite shape objects. This is a relatively simple shader:
This is what the shader material looks like applied to a generic square sprite, and the sprite shape. This is using a Light 2D
Spot light:
Clearly this shader is working fine for the generic square sprite, but not the sprite shape. I would think that maybe sprite shapes just can't be lit, and that would be the end of that. But when I apply the default Sprite-Lit-Default
material, it seems to work just fine:
Albeit it requires some sort of "refresh" of the sprite shape, as it doesn't work when its assigned, but it will work once the sprite shape's "Stretch UV" option is toggled (to note, it doesn't matter if "Stretch UV" is toggled on or off, toggling it is just used to refresh something about the sprite shape).
The reason I can't just use the built-in Sprite-Lit-Default
material is because I want to include other properties/effects to the custom shader beyond just the basic lighting.
I'm sure there's a piece of information/knowledge that I lack, or something that I'm missing, but at the moment I'm all out of ideas. Even if a concrete answer of "it's not possible because XYZ" would make me happy at this point.
Some Housekeeping information:
- Unity version: 2021.3.8f1
- Sprite Shape version: 7.0.6
- Shader Graph version: 12.1.7
- Using the Renderer 2D in URP (Because 2d lighting)
Any other information I'd be more than happy to give. I'm not sure what else would be relevant.