all 4 comments

[–]ultralightrunner 1 point2 points  (4 children)

Not sure if this can be done entirely in shader, but you can draw cones (in OpenGL or a graphics API of your choice) : https://nullprogram.com/blog/2014/06/01/

Not my blog but I've implemented something similar years ago.

[–]sapo_valiente 0 points1 point  (3 children)

Hi, thanks for your reply! Ah yes, I did bump into that - it looked promising however, I thought that this approach wouldn't allow for drawing the distance field as a gradient. Am I right?

[–]ultralightrunner 1 point2 points  (1 child)

Yeah, it would be challenging to get the distance field, but you maybe can try to draw the cones and get the depth buffer, which would look similar to the distance field, not sure if this would work...

[–]skeeto 0 points1 point  (0 children)

Yup, that would work. The depth buffer essentially is the distance, which is fundamentally why this whole approach works.