Hey everybody!
Finally I’ve got some spare time again. I tried to get started with shaders about two months ago and managed to create a simple retro effect shader as an imageeffect shader (http://i.imgur.com/VZ1Hy6k.png). But now I’d like to have this effect as a shader that’s put onto objects and creates a world where some objects are “retro” and some are not.
But I don’t quiet see how I would do the pixelation in this case. I don’t need the shader written out for me, just an idea how one could achieve this effect in a vertex/fragment or surface shader (preferably both but I assume it will be quiet similar).
My problem is that I don’t see how I can get the information about the other final pixels. Simply put I have to make some pixels look like other pixels to get a pixelation effect. To make pixel A look like pixel B, I have to know how pixel B looks. In the case of an imageeffect, the whole “normal” rendering process of the object is already done and I have the final picture (that will be displayed on the screen) as a 2D texture to work on. This meant that I already knew how all the pixels looked like (before pixelating, that is) and also made it very easy to access the other pixels by texture coordinates. But as far as my understanding goes, I don’t have this when using the shader on an object in the scene instead of anafter imageeffect and I’m puzzled what’s the way to go about it.
I found this but that only shows how to pixelate an area of the screen and not an actual object and I don’t think it can somehow be adapted to work the way I need it to.
Any idea how I could approach this problem is greatly appreciated!
Thanks in advance!