app/internal/gpu: don't apply gamma linearization to alpha values

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-17 14:35:10 +02:00
parent 0d4cd822ef
commit 0c75e7c605
+2 -1
View File
@@ -921,7 +921,8 @@ func (r *renderer) uploadTexture(img *image.RGBA) {
func gamma(r, g, b, a uint32) [4]float32 {
color := [4]float32{float32(r) / 0xffff, float32(g) / 0xffff, float32(b) / 0xffff, float32(a) / 0xffff}
// Assume that image.Uniform colors are in sRGB space. Linearize.
for i, c := range color {
for i := 0; i <= 2; i++ {
c := color[i]
// Use the formula from EXT_sRGB.
if c <= 0.04045 {
c = c / 12.92