Pixelate into view (Texture Resolution)

I improved this shader such that the depixelization occurs at texture resolution

(If you want to customize the pixel resolution I’ve uploaded another shader)

My first shader(s)!
Enjoy 🙂

Shader code
shader_type canvas_item;

uniform float time:hint_range(0.0, 1.57, 0.001) = 1.0;

float rand(vec2 co){
    return fract(sin(dot(co.xy ,vec2(12.9898,96.233))) * 43758.5453);
}

void fragment()
{
	vec2 texture_resolution = 1.0 / TEXTURE_PIXEL_SIZE;
	vec2 within_texture_pixel=floor(UV * texture_resolution);
	vec4 color= texture(TEXTURE,UV);
	
	if(sin(time) > rand(within_texture_pixel))
		COLOR = color;
	else
		COLOR = vec4(0.0,0.0,0.0,0.0);
}
Tags
fade, pixel, pixelate, transition
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from cak3_lover

Pixelate into view (Custom Resolution)

Related shaders

Pixelate into view (Custom Resolution)

Pixelate Filter

Pixelate

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments