Hi, in one of my games I would like to be able to toggle "old school" mode which would simulate large pixels. So I would like to, essentially, pixelate the entire screen/stage with pixels of specific size.
I thought a shader might be a good way to go about this so I tried messing with the blur samples, but alas, shaders are still a bit over my head.
Simple example of what I mean:
https://www.photofunny.net/efectos/grandes/pixelate_images.jpgAny ideas on how to best accomplish this?
Thanks,
Eric
Comments
Similarly to the blur effect you would need to render your scene to a rendertarget, then render this rendertarget to screen with a shader.
The shader would align texture coordinates to a grid and sample the texture at that point.
Likes: EricCarr
Likes: hgy29, EricCarr
Fragmenter - animated loop machine and IKONOMIKON - the memory game
this may give you an idea about how to do it. the only important line is
mediump vec2 tc=fTexCoord-mod(fTexCoord,(fRad+1)/100.0);
which rounds the coordinate depending on fRad and then
frag=texture2D(fTexture, tc);
returns the color at that rounded value.
Fragmenter - animated loop machine and IKONOMIKON - the memory game
A shader could be used to make it look like an old crt screen when scaled up maybe.
Likes: keszegh, totebo, EricCarr, antix, MoKaLux
https://deluxepixel.com
https://deluxepixel.com