So I’m using a very low-resolution texture and updating its pixels dynamically in order to create a blurry sort of overlay. When I use a pre-made texture with various degrees of alpha, and switch on bilinear or trilinear filtering, things work fine.
What I want to do, though, is change things in code. I start from an empty texture and use SetPixel() to add a color (in this case green) to the given location, then use Apply(). Unfortunately, this is the result I get:
What is the red there? No matter what color I pass to SetPixel(), I get this red glow around the colors instead of the desired green. The red is influenced by the Sprite’s overall color - if I set it to black, for instance, the red turns black. The problem occurs even when using Unity’s built-in colors, like Color.green.
Why is there red surrounding the green, and how do I get rid of it? Why doesn’t it occur with textures imported from a file?