Improve PortMaster performance and controls

This commit is contained in:
Alexander Sellite 2026-08-15 09:53:30 -04:00
parent 9afa60f6a5
commit 57df54d82d
14 changed files with 328 additions and 126 deletions

View file

@ -4,10 +4,14 @@ uniform sampler2D pattern_texture : source_color, repeat_enable, filter_nearest;
uniform vec2 source_tile_size = vec2(128.0, 128.0);
uniform float display_scale : hint_range(0.5, 2.0, 0.05) = 0.85;
uniform vec2 scroll_velocity_pixels = vec2(-7.0, -5.0);
uniform bool animation_enabled = true;
void fragment() {
vec2 viewport_pixels = 1.0 / SCREEN_PIXEL_SIZE;
vec2 display_tile_size = max(source_tile_size * display_scale, vec2(1.0));
vec2 moving_pixels = UV * viewport_pixels + TIME * scroll_velocity_pixels;
vec2 moving_pixels = UV * viewport_pixels;
if (animation_enabled) {
moving_pixels += TIME * scroll_velocity_pixels;
}
COLOR = texture(pattern_texture, moving_pixels / display_tile_size);
}