Native RenderGylph should handle alpha properly

This commit is contained in:
Chris Speciale
2024-10-28 23:38:18 -04:00
committed by GitHub
parent 9cbdc83605
commit e65e863918

View File

@@ -988,6 +988,7 @@ namespace lime {
unsigned char r = bitmap.buffer[i * pitch + j * 3 + 0];
unsigned char g = bitmap.buffer[i * pitch + j * 3 + 1];
unsigned char b = bitmap.buffer[i * pitch + j * 3 + 2];
unsigned char a = (r + g + b) / 3;
//Red
position[(i * width + j) * 4 + 0] = r;
@@ -995,8 +996,8 @@ namespace lime {
position[(i * width + j) * 4 + 1] = g;
//Blue
position[(i * width + j) * 4 + 2] = b;
//Alpha (fully opaque)
position[(i * width + j) * 4 + 3] = 255;
//Alpha
position[(i * width + j) * 4 + 3] = a;
}
}