Answer: Yes, but I'm sure someone else can do it better. Here is my attempt:
(note: view image at full size to see the actual screentones. They get messed up when you zoom out)
The code:
shader_type canvas_item;
void fragment() {
vec4 cur_pixel = texture(TEXTURE, UV);
float average = (cur_pixel.r + cur_pixel.g + cur_pixel.b) / 3.0;
if (average < 0.10) {
COLOR = vec4(0.0, 0.0, 0.0, cur_pixel.a);
} else if (average <= 0.20){
if (int(UV.x/TEXTURE_PIXEL_SIZE.x)%3==0&&int(UV.y/TEXTURE_PIXEL_SIZE.y)%3==0) {
COLOR = vec4(1.0, 1.0, 1.0, cur_pixel.a);
} else {
COLOR = vec4(0.0, 0.0, 0.0, cur_pixel.a);
}
} else if (average <= 0.40){
if (int(UV.x/TEXTURE_PIXEL_SIZE.x)%2==0&&int(UV.y/TEXTURE_PIXEL_SIZE.y)%2==0) {
COLOR = vec4(1.0, 1.0, 1.0, cur_pixel.a);
} else {
COLOR = vec4(0.0, 0.0, 0.0, cur_pixel.a);
}
} else if (average <= 0.60){
if (int(UV.x/TEXTURE_PIXEL_SIZE.x)%2==0&&int(UV.y/TEXTURE_PIXEL_SIZE.y)%2==0) {
COLOR = vec4(0.0, 0.0, 0.0, cur_pixel.a);
} else {
COLOR = vec4(1.0, 1.0, 1.0, cur_pixel.a);
}
} else if (average <= 0.80){
if (int(UV.x/TEXTURE_PIXEL_SIZE.x)%3==0&&int(UV.y/TEXTURE_PIXEL_SIZE.y)%3==0) {
COLOR = vec4(0.0, 0.0, 0.0, cur_pixel.a);
} else {
COLOR = vec4(1.0, 1.0, 1.0, cur_pixel.a);
}
} else {
COLOR = vec4(1.0, 1.0, 1.0, cur_pixel.a);
}
}
I'll try to improve this but you forumites have any suggestions on how I can improve this?