- Home /
Invert colours for a 2D sprite
Hello Everybody,
I searched a lot for a script which can invert the colours of my 2D sprites. I am knew to shaders and meshes so if anyone can explain a little bit and/or has a code for that I would be very grateful.
Thanks in advance.
Comment
I'm sure there is a invert colors shader available online.
Answer by tanoshimi · Aug 22, 2017 at 01:43 PM
Well, in the fragment shader instead of:
fixed4 col;
return col;
You'd do:
fixed4 col;
return fixed4(1.0-col.r, 1.0-col.g, 1.0-col.b, 1.0);
That's it.
Your answer
Follow this Question
Related Questions
how to enable Compute shaders for OpenGL ES 3.X in Unity 5.1.x? 1 Answer
masking problem 0 Answers
Standard Shader not correctly working on Android 0 Answers
Rotating a 2D sprite(Ring) in a fixed position 0 Answers
Use sprite mesh for filled image 1 Answer