How to get a pixel and change it (Dithering with Floyd-Steinberg)


I was thinking about making a PostProcess Material that dithers the screen with Floyd-Steinberg algorithm. I followed a very good guide: Dithering with Floyd-Steinberg in C++ - YouTube .

I managed to get everything in UE4 so far except the main thing - the dither algorithm itself.

The problem is that I need to get up, down and side pixels from the current pixel and I dont know how to do that in material graph. There is a node ScreenPosition that gives me position of the current pixel, this is good. But I need the up, down and side pixels of this pixel. And I will also need to update these pixels by changing their color.

So my question is: How to get side pixels and how to change their color? Is it even possible?

Thank you in advance

I could get side pixels by adding or subtracting a value (but what value if hte Position is a float 0 - 1) to/from the current pixel, but then how do I update them all together at once?