I’m working with URP on a 2D game. I made an unlit sprite shader to do a black gradient fade (solid black to transparent) and applied it to a screen space canvas UI image. It works fine in the scene view, but in game view the portions that should be transparent are a solid dark red.
All the shader does is feed a black color to the Base Color input of the master node, and a black to white gradient to the Alpha input.
The shader’s blend mode is set to Alpha.
I currently don’t have access to my pc, so i will provide screenshots later. But if anyone has some ideas/experience with why this could he happening, might as well ask now.
Edit: So, a few seconds of extra googling and I somehow found my exact issue, on a reddit post I’ve never seen before. Will try this fix when I get home.
Not sure, but maybe related to postprocessing or color space?
You can try clamp color and alpha values and if it’s still red, then it should be something outside graph.
Don’t know how helpful this will be; but when the sprite’s color alpha (in the inspector) is anything above 0, it instantly appears, at 1 it’s a solid dark red, as the alpha increases, the black gradient at the top slowly comes in.