Native RenderGylph should handle alpha properly
This commit is contained in:
@@ -988,15 +988,16 @@ namespace lime {
|
|||||||
unsigned char r = bitmap.buffer[i * pitch + j * 3 + 0];
|
unsigned char r = bitmap.buffer[i * pitch + j * 3 + 0];
|
||||||
unsigned char g = bitmap.buffer[i * pitch + j * 3 + 1];
|
unsigned char g = bitmap.buffer[i * pitch + j * 3 + 1];
|
||||||
unsigned char b = bitmap.buffer[i * pitch + j * 3 + 2];
|
unsigned char b = bitmap.buffer[i * pitch + j * 3 + 2];
|
||||||
|
unsigned char a = (r + g + b) / 3;
|
||||||
|
|
||||||
//Red
|
//Red
|
||||||
position[(i * width + j) * 4 + 0] = r;
|
position[(i * width + j) * 4 + 0] = r;
|
||||||
//Green
|
//Green
|
||||||
position[(i * width + j) * 4 + 1] = g;
|
position[(i * width + j) * 4 + 1] = g;
|
||||||
//Blue
|
//Blue
|
||||||
position[(i * width + j) * 4 + 2] = b;
|
position[(i * width + j) * 4 + 2] = b;
|
||||||
//Alpha (fully opaque)
|
//Alpha
|
||||||
position[(i * width + j) * 4 + 3] = 255;
|
position[(i * width + j) * 4 + 3] = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user