3 ms·
Why are outlines so expensive? The article assumes we all know.
by wolverine876 5y ago
Why are outlines so expensive? The article assumes we all know.
- thom 5y agoYeah, I also have no intuition about this and fail to grasp the problem. When the author talked of rendering a slightly larger mesh to a white texture I just assumed that was it, but apparently not. I assume much of the complexity is to do with where in the pipeline this issue is being handled (i.e. just in shaders).
- bastawhiz 5y agoOversimplification, but the high-level problem is that you have a 3D object, with overlapping bits, holes, thin jutting edges, and other unusual geometry. The outline is behind that shape (and usually, only that shape), but the outline is a "flat" 2D shape. As the images with the black outline show near the top of the article, scaling up the component parts and drawing them as black don't achieve a good effect. The "correct" approach is to find each opaque bit of the 3D object you're outlining and draw opaque outline pixels within a radius of the outline width around it. This is slow, however, since you're essentially operating per-pixel. To achieve reasonable performance, there's a good amount of optimizing that needs to happen.