Skip to content

Commit d580523

Browse files
Revert "Slightly optimize IndexedToRGB.gdshader"
This reverts commit 7cf87ac.
1 parent 11da07b commit d580523

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Shaders/IndexedToRGB.gdshader

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ uniform sampler2D palette_texture : filter_nearest;
77
uniform sampler2D indices_texture : filter_nearest;
88

99
void fragment() {
10-
float index = texture(indices_texture, UV).r * 255.0;
10+
float index = texture(indices_texture, UV).r;
1111
if (index <= EPSILON) { // If index is zero, make it transparent
1212
COLOR = vec4(0.0);
1313
}
1414
else {
1515
float n_of_colors = float(textureSize(palette_texture, 0).x);
16-
index -= 1.0;
17-
float index_normalized = index / n_of_colors;
16+
index -= 1.0 / 255.0;
17+
float index_normalized = ((index * 255.0)) / n_of_colors;
1818
if (index_normalized + EPSILON < 1.0) {
1919
COLOR = texture(palette_texture, vec2(index_normalized + EPSILON, 0.0));
2020
}

0 commit comments

Comments
 (0)