Hi, I want to change sprite colour only where it’s not being affected by 2d lights, I tried to create a shader using shader graph but couldn’t find any node that will be able to do the task. How can I achieve the desired effect ? Any advice will be helpful.
It’s not clear the effect you want, and how it might differ from using colored lights. For example, blue-shifting the color of a sprite would be possible by simply using a blue-tinted light.
From your description I don’t think a direct implementation is possible because 2D Light data is “behind the scenes” in Shader Graph.
But please describe in greater detail the effect you want. An illustration may be helpful. Perhaps there’s a workaround.
This can’t be done with Shader Graph because lighting is applied after your graph runs, and you have no control over that. It should be possible, however, but you would need to create your own copy of Sprite-Lit-Default and then modify it. This would not be an easy task for a beginner.
Haven’t really thought it through, but perhaps you could accomplish something like what you want with masks, which would be more beginner-friendly. Unity - Manual: Sprite Masks
You have more options now. What you could do is have an Sprite Unlit shadergraph where you sample from this Light Texture node, then you could interpret that light data as you see fit. For example, if the light node’s value is above/below some threshold, then the object is “in the light” or “in the dark” and you can for each apply a different effect.