   float border_opacity = dynamic_tile_data_b2.z;
   float boxes_opacity = dynamic_tile_data_b2.w;
 
-  float frames_per_axis = floor(sprite_size /tile_size);
-  float frames_per_sprite = frames_per_axis * frames_per_axis;
+
 
   float f;
   if(static_tile < 0.) {

    }
    f *= boxes_opacity;
  } else if (static_tile >= 1.) {
    vec2 number_tex_uv = (vec2(mod(static_tile, frames_per_axis), floor(static_tile/frames_per_axis)) + normalized_uv) * tile_size / sprite_size;
    f = mix(f, 1., texture2D(static_sprite, number_tex_uv).a);
  }

  // Blend static outline on top
  vec2 outline_tex_uv = (vec2(0.) + normalized_uv) * tile_size / sprite_size;
  f = mix(f, 1., texture2D(static_sprite, outline_tex_uv).a * border_opacity);

  // Blend flash on top
  vec2 flash_tex_uv = (vec2(9., 0.) + normalized_uv) * tile_size / sprite_size;
  f = mix(f, 1., texture2D(static_sprite, flash_tex_uv).a * flash_opacity);

  // Change color according to highlight setting

uniform sampler2D idle_sprites[4];
uniform sampler2D static_sprite;
uniform vec2 paddings;

float frames_per_axis = floor(sprite_size /tile_size);
float frames_per_sprite = frames_per_axis * frames_per_axis;

vec2 static_tile_coords(float idx) {
  return vec2(mod(idx, frames_per_axis), floor(idx/frames_per_axis));
}

void main() {
  vec4 white = vec4(1.);
