Hot answers tagged

1 vote
Accepted

How to generate a gradient to the edges of a triangle in GLSL?

You can calculate the perpendicular distance from each edge, and then take the minimum of the three edges. This is related to barycentric coordinates (which are normalized edge distances). If you ...
1 vote
Accepted

efficient way to get min/max distance during rendering

There is no way in general to know whether a fragment you're currently shading will make it into the final image or not. You could be rendering 10,000 different meshes, and the last one could cover up ...

Only top scored, non community-wiki answers of a minimum length are eligible