Texture Pixelation Shader?

Hi All,

I’m in need of some code to pixelate a texture by a given amount in the style of Photoshop’s pixelate filter. Ideally I’d have a slider from 0 to 1. 0 being an untouched image 1 being fully pixelated.

I’m just starting with ShaderLab code so my question is this. Is it sensible to use for ShaderLab for this or would I be better off doing this in normal (C#) code instead?

Thanks in advance for any help, pointers or code snippets.

A shader would be more efficient, certainly, but you’ll need to write it in Cg. However, manipulating the texture data would definitely work, and would probably be OK for performance (unless you’re changing very large textures very often :wink: ).