Anri/AdBlockNot
Archived
1
0
Fork 0
This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
AdBlockNot/shaders/view.gdshader

27 lines
713 B
Text
Raw Permalink Normal View History

shader_type spatial;
const int pixel_size = 6;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
float x = float(int(FRAGCOORD.x) % pixel_size);
float y = float(int(FRAGCOORD.y) % pixel_size);
x = FRAGCOORD.x + floor(float(pixel_size)/2.) - x;
y = FRAGCOORD.y + floor(float(pixel_size)/2.) - y;
ALBEDO = texture(SCREEN_TEXTURE, vec2(x,y)/VIEWPORT_SIZE).xyz;
}
2024-01-28 12:48:49 +01:00
void light() {
// Called for every pixel for every light affecting the material.
// Uncomment to replace the default light processing function with this one.
2024-01-28 12:48:49 +01:00
}