{"author_link":"\/users\/filgreen3","author_name":"filgreen3","author_uid":"filgreen3","comments":[],"epoch":1777060203,"event":"LD59","format":"md","ldjam_node_id":431980,"likes":6,"metadata":{"p_key":"96663","p_author":"filgreen3","p_authorkey":"1104116","p_urlkey":"312309","p_title":"Hidden part of my game","p_cat":"LDJam ","p_event":"LD59","p_time":"1777060203","p_likes":"6","p_comments":"0","p_status":"WAYBACK","us_key":"1104116","us_name":"filgreen3","us_username":"filgreen3","event_start":"1776470400","event_key":"113","event_name":"Ludum Dare 59"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD59","removed_author":false},"_superparent":424249,"_trust":3,"author":104116,"body":"## I used asimple trick to add style to my game by limiting the color space. This is how it looks without it and with it.\n\n![Screenshot 2026-04-24 at 21.08.38.png](\/\/\/raw\/4b6\/91\/z\/72996.png)\n![Screenshot 2026-04-24 at 21.08.23.png](\/\/\/raw\/4b6\/91\/z\/72997.png)\n![Screenshot 2026-04-24 at 21.08.17.png](\/\/\/raw\/4b6\/91\/z\/72998.png)\n\n\n\n```gdshader\nshader_type canvas_item;\n\nuniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_nearest;\n\nuniform sampler2D palette_tex : filter_nearest;\nuniform int color_count : hint_range(1, 256) = 16;\nuniform vec4 base_color : source_color = vec4(1.0, 1.0, 1.0, 1.0);\nuniform float blend_amount : hint_range(0.0, 1.0) = 1.0;\n\nuniform sampler2D dither_tex : filter_nearest, repeat_enable;\nuniform float dither_scale : hint_range(1.0, 128.0) = 1.0;\nuniform float dither_intensity : hint_range(0.0, 1.0) = 0.1;\nuniform bool dither_enabled = false;\n\nvec4 palette_snap(vec3 color) {\n\tfloat u0 = 0.5 \/ float(color_count);\n\tvec4 best = texture(palette_tex, vec2(u0, 0.5));\n\tfloat dist = distance(color, best.rgb);\n\tfor (int j = 1; j < color_count; j++) {\n\t\tfloat u = (float(j) + 0.5) \/ float(color_count);\n\t\tvec4 c = texture(palette_tex, vec2(u, 0.5));\n\t\tfloat d = distance(color, c.rgb);\n\t\tif (d < dist) {\n\t\t\tdist = d;\n\t\t\tbest = c;\n\t\t}\n\t}\n\treturn best;\n}\n\nvoid fragment() {\n\tvec4 color = texture(SCREEN_TEXTURE, SCREEN_UV);\n\tvec4 original_color = color;\n\n\tif (dither_enabled) {\n\t\tvec2 screen_px = FRAGCOORD.xy;\n\t\tivec2 dither_size = textureSize(dither_tex, 0);\n\t\tvec2 scaled = floor(screen_px \/ dither_scale);\n\t\tvec2 wrapped = mod(scaled, vec2(dither_size));\n\t\tvec2 dither_uv = (wrapped + 0.5) \/ vec2(dither_size);\n\t\tfloat dither_val = texture(dither_tex, dither_uv).r - 0.5;\n\t\tcolor.rgb += dither_val * dither_intensity;\n\t}\n\n\tvec4 palette_color = palette_snap(color.rgb) * base_color;\n\tCOLOR = mix(original_color, palette_color, blend_amount);\n}\n```","comments":2,"comments-timestamp":"2026-04-24T21:14:25Z","created":"2026-04-24T18:05:49Z","files":[],"files-timestamp":0,"id":431980,"love":6,"love-timestamp":"2026-04-24T22:17:44Z","meta":[],"modified":"2026-04-24T22:17:44Z","name":"Hidden part of my game","node-timestamp":"2026-04-24T19:50:03Z","parent":430749,"parents":[1,5,9,424249,430749],"path":"\/events\/ludum-dare\/59\/signal-repair-team\/hidden-part-of-my-game","published":"2026-04-24T19:50:03Z","scope":"public","slug":"hidden-part-of-my-game","subsubtype":"","subtype":"","type":"post","version":1371750},"node_metadata":{"n_key":"431980","n_urlkey":"312309","n_parent":"430749","n_path":"\/events\/ludum-dare\/59\/signal-repair-team\/hidden-part-of-my-game","n_slug":"hidden-part-of-my-game","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"104116","n_created":"1777053949","n_modified":"1777069064","n_version":"1371750","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/59\/signal-repair-team\/hidden-part-of-my-game","text":"## I used asimple trick to add style to my game by limiting the color space. This is how it looks without it and with it.\n\n![Screenshot 2026-04-24 at 21.08.38.png](\/\/\/raw\/4b6\/91\/z\/72996.png)\n![Screenshot 2026-04-24 at 21.08.23.png](\/\/\/raw\/4b6\/91\/z\/72997.png)\n![Screenshot 2026-04-24 at 21.08.17.png](\/\/\/raw\/4b6\/91\/z\/72998.png)\n\n\n\n```gdshader\nshader_type canvas_item;\n\nuniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_nearest;\n\nuniform sampler2D palette_tex : filter_nearest;\nuniform int color_count : hint_range(1, 256) = 16;\nuniform vec4 base_color : source_color = vec4(1.0, 1.0, 1.0, 1.0);\nuniform float blend_amount : hint_range(0.0, 1.0) = 1.0;\n\nuniform sampler2D dither_tex : filter_nearest, repeat_enable;\nuniform float dither_scale : hint_range(1.0, 128.0) = 1.0;\nuniform float dither_intensity : hint_range(0.0, 1.0) = 0.1;\nuniform bool dither_enabled = false;\n\nvec4 palette_snap(vec3 color) {\n\tfloat u0 = 0.5 \/ float(color_count);\n\tvec4 best = texture(palette_tex, vec2(u0, 0.5));\n\tfloat dist = distance(color, best.rgb);\n\tfor (int j = 1; j < color_count; j++) {\n\t\tfloat u = (float(j) + 0.5) \/ float(color_count);\n\t\tvec4 c = texture(palette_tex, vec2(u, 0.5));\n\t\tfloat d = distance(color, c.rgb);\n\t\tif (d < dist) {\n\t\t\tdist = d;\n\t\t\tbest = c;\n\t\t}\n\t}\n\treturn best;\n}\n\nvoid fragment() {\n\tvec4 color = texture(SCREEN_TEXTURE, SCREEN_UV);\n\tvec4 original_color = color;\n\n\tif (dither_enabled) {\n\t\tvec2 screen_px = FRAGCOORD.xy;\n\t\tivec2 dither_size = textureSize(dither_tex, 0);\n\t\tvec2 scaled = floor(screen_px \/ dither_scale);\n\t\tvec2 wrapped = mod(scaled, vec2(dither_size));\n\t\tvec2 dither_uv = (wrapped + 0.5) \/ vec2(dither_size);\n\t\tfloat dither_val = texture(dither_tex, dither_uv).r - 0.5;\n\t\tcolor.rgb += dither_val * dither_intensity;\n\t}\n\n\tvec4 palette_color = palette_snap(color.rgb) * base_color;\n\tCOLOR = mix(original_color, palette_color, blend_amount);\n}\n```","title":"Hidden part of my game","wayback_source":[]}