The example code is storing encoded absolute UV positions in an R16G16_SNorm. It’s enough precision to handle full screen 4k outlines with some modest amount of anti-aliasing precision.

But if it was changed to store relative pixel offsets and limit yourself to less than 126 pixel wide outlines with no AA (encode with (pixelOffset + 126.0) / 255.0), or maybe 31 pixel outlines with some AA ((pixelOffset + 31.0) / 63.0), then you could easily use an 8 bit format to store the pixel offsets. Otherwise you could also encode a value with a greater precision / range across two 8 bit channels.

Tech Artist & Graphics Programmer lately focused on Unity VR game dev.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store