diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index b5728d57e..295602e8e 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -765,14 +765,14 @@ func bitmap_to_image(bitmap: BitMap, square := true) -> Image: var height := bitmap.get_size().y if square: var square_size = max(width, height) - image.create(square_size, square_size, false, Image.FORMAT_L8) + image.create(square_size, square_size, false, Image.FORMAT_LA8) else: - image.create(width, height, false, Image.FORMAT_L8) + image.create(width, height, false, Image.FORMAT_LA8) image.lock() for x in width: for y in height: var pos := Vector2(x, y) - var color = Color(1, 1, 1) if bitmap.get_bit(pos) else Color(0, 0, 0) + var color = Color(1, 1, 1, 1) if bitmap.get_bit(pos) else Color(0, 0, 0, 0) image.set_pixelv(pos, color) image.unlock() return image diff --git a/src/Shaders/ColorReplace.shader b/src/Shaders/ColorReplace.shader index f2c4efe2e..99f9cb6ff 100644 --- a/src/Shaders/ColorReplace.shader +++ b/src/Shaders/ColorReplace.shader @@ -33,5 +33,5 @@ void fragment() { // applies on each pixel seperately col = new_color; // Mix selects original color if there is selection or col if there is none - COLOR = mix(original_color, col, selection_color.r); + COLOR = mix(original_color, col, selection_color.a); } diff --git a/src/Shaders/Desaturate.shader b/src/Shaders/Desaturate.shader index 6266b797c..d7f5e0435 100644 --- a/src/Shaders/Desaturate.shader +++ b/src/Shaders/Desaturate.shader @@ -56,7 +56,7 @@ void fragment() { vec3 output; if(affect_selection && has_selection) { - output = mix(original_color.rgb, stdPrime, selection_color.r); + output = mix(original_color.rgb, stdPrime, selection_color.a); } else { output = stdPrime; } diff --git a/src/Shaders/HSV.shader b/src/Shaders/HSV.shader index fec9908b2..9e03989ca 100644 --- a/src/Shaders/HSV.shader +++ b/src/Shaders/HSV.shader @@ -63,7 +63,7 @@ void fragment() { col = hsb2rgb(hsb); vec3 output; if(affect_selection && has_selection) - output = mix(original_color.rgb, col, selection_color.r); + output = mix(original_color.rgb, col, selection_color.a); else output = col; COLOR = vec4(output.rgb, original_color.a); diff --git a/src/Shaders/Invert.shader b/src/Shaders/Invert.shader index e1c38a8c0..8024450b7 100644 --- a/src/Shaders/Invert.shader +++ b/src/Shaders/Invert.shader @@ -26,7 +26,7 @@ void fragment() { vec4 output; if(affect_selection && has_selection) - output = mix(original_color.rgba, col, selection_color.r); + output = mix(original_color.rgba, col, selection_color.a); else output = col; diff --git a/src/Shaders/MarchingAntsOutline.shader b/src/Shaders/MarchingAntsOutline.shader index 9dd0b85c7..0d0d63da2 100644 --- a/src/Shaders/MarchingAntsOutline.shader +++ b/src/Shaders/MarchingAntsOutline.shader @@ -21,7 +21,7 @@ bool hasContraryNeighbour(vec2 uv, vec2 texture_pixel_size, sampler2D texture) { vec2 xy1 = uv + texture_pixel_size * vec2(x1, y1); vec2 xy2 = uv + texture_pixel_size * vec2(x2, y2); - if (xy1 != clamp(xy1, vec2(0.0), vec2(1.0)) || texture(texture, xy1).r == 0.0 || xy2 != clamp(xy2, vec2(0.0), vec2(1.0)) || texture(texture, xy2).r == 0.0) { + if (xy1 != clamp(xy1, vec2(0.0), vec2(1.0)) || texture(texture, xy1).a == 0.0 || xy2 != clamp(xy2, vec2(0.0), vec2(1.0)) || texture(texture, xy2).a == 0.0) { return true; } @@ -32,7 +32,7 @@ void fragment() { vec2 uv = UV; COLOR = texture(TEXTURE, uv); - if ((COLOR.r > 0.0) == true && hasContraryNeighbour(uv, TEXTURE_PIXEL_SIZE, TEXTURE)) { + if ((COLOR.a > 0.0) == true && hasContraryNeighbour(uv, TEXTURE_PIXEL_SIZE, TEXTURE)) { vec4 final_color = first_color; // Generate diagonal stripes if(animated)