Distance fields

Added distance fields using an algorithm called “jump flooding”. It can be used to add bevels. The second output contains the distance values, ill swap them around at some stage.

DistanceTest

http://weesals.com/Releases/HTML/Surface/R6/

I found this animation helpful in understanding the concept https://www.shadertoy.com/view/4syGWK, they use a power of 2 when spreading values, but I found a power of 3 works great too, and is much cheaper – that is what the Quality slider controls.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s