This commit is contained in:
Johannes Hendrik Gerard van der Weide 2024-12-05 15:46:39 +01:00
parent aae55b36e6
commit e54abe1f33
40 changed files with 1327 additions and 20 deletions

14
pixel_art.gdshader Normal file
View file

@ -0,0 +1,14 @@
shader_type canvas_item;
render_mode skip_vertex_transform, unshaded;
const vec2 target_resolution = vec2(320.0, 180.0);
const float colors_per_channel = 16.0;
uniform sampler2D screen_texture: hint_screen_texture, filter_nearest;
void fragment() {
vec2 uv = floor(SCREEN_UV * target_resolution) / target_resolution;
vec3 color = texture(screen_texture, uv).rgb;
vec3 quantized_color = floor(color * colors_per_channel) / colors_per_channel;
COLOR = vec4(quantized_color, 1.0);
}