- Home /
Changing color of texture with transparency efficiently
Hello!
So I am having some trouble efficiently changing the color of a texture with transparency. I have an icon that is imported as a read/writable texture and I am trying to have it change colors over time. However, the icon is transparent, and I don't want to change the color of the transparent parts.
I have tried looking up many ways to do this, but all are very inefficient and simply unacceptably resource-intensive, or they change all the colors in the texture. I am talking about the get and set pixel methods.
I am wondering if there is any way around this problem and whether Unity has an easier way of changing a single color of the texture to something else.
I am looking for some sort of setColor method that I can use, or a different way to import the texture.
Thanks.
You can create a shader to change the color at runtime. I have no idea what type change you are talking about but shader is efficient and much faster.
Your answer
Follow this Question
Related Questions
Texture and Texture2D for GUI (simple question) 1 Answer
Texture2D: pixel Specific alpha not working? 4 Answers
Blending two Texture2D 1 Answer
change part of texture with color or other texture 0 Answers