1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Revert "Use L8 format for selection texture"

This reverts commit 8a3414f83a.
This commit is contained in:
Manolis Papadeas 2022-03-23 03:56:47 +02:00
parent 8a3414f83a
commit 3727caf9c4
6 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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;

View file

@ -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)