Sitemap
Ben Golus
1 min readAug 13, 2020

--

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.

--

--

Ben Golus
Ben Golus

Written by Ben Golus

Tech Artist & Graphics Programmer lately focused on Unity VR game dev. https://ko-fi.com/bgolus

Responses (1)