Unity3D and Texture2D. GetPixel returns wrong values
- by Heisenbug
I'm trying to use Texture2D set and get colors, but I encountered a strange behavior.
Here's the code to reproduce it:
Texture2D tex = new Texture2D(2,2, TextureFormat.RGBA32 ,false);
Color col = new Color(1.0f,0.5f,1.0f,0.5f); //col values: 1.00, 0.500, 1.00, 0.500
tex.setPixel(0,0,col);
Color colDebug = tex.getPixel(0,0); //col values: 1.00,…