mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 16:24:44 -04:00
Replace godot-gifexporter with godot-gdgifexporter (#295)
Add exporting in a separate thread and a progress bar Remove background color option from gif export
This commit is contained in:
parent
e4aa17b01c
commit
f3bce3857a
16 changed files with 1073 additions and 80 deletions
22
addons/gdgifexporter/lookup_similar.shader
Normal file
22
addons/gdgifexporter/lookup_similar.shader
Normal file
|
@ -0,0 +1,22 @@
|
|||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D lut;
|
||||
|
||||
void fragment() {
|
||||
vec4 color = texture(TEXTURE, UV);
|
||||
vec4 similar = texture(lut, vec2(0.5 / 256.0, 0.5));
|
||||
float index = 0.0;
|
||||
if (color.a > 0.0) {
|
||||
float dist = distance(color.xyz, similar.xyz);
|
||||
for (int i = 1; i < 256; i++) {
|
||||
vec4 c = texture(lut, vec2((float(i) + 0.5) / 256.0, 0.5));
|
||||
float d = distance(color.xyz, c.xyz);
|
||||
if (d < dist) {
|
||||
dist = d;
|
||||
index = float(i) / 255.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
COLOR = vec4(vec3(index), 1.0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue