Files
Super-Mario-Bros.-Remastere…/Scenes/Parts/DitheredTransparency.gdshader
2025-09-13 16:30:32 +01:00

19 lines
420 B
Plaintext

shader_type canvas_item;
void fragment() {
vec4 tex_color = texture(TEXTURE, UV);
vec4 color = tex_color;
// Get pixel coordinate in texture space
vec2 tex_size = vec2(textureSize(TEXTURE, 0)); // Godot 4
ivec2 coord = ivec2(floor(UV * tex_size));
// Simple checker pattern based on texture pixel positions
bool checker = (coord.x + coord.y) % 2 == 0;
if (checker)
{
discard;
}
}