3 ms·
That's cool! Although I'll take linear code with bunch of matrix-vector products over bunch of branches any day :-) As you may know, where this algorithm of 2D
by NotCamelCase 8y ago
That's cool! Although I'll take linear code with bunch of matrix-vector products over bunch of branches any day :-)
As you may know, where this algorithm of 2D homogeneous rasterization really shines is in how it simplifies the triangle setup by deferring the perspective-divide until later rasterizer stagee. It's tricky for cases where (w <= 0.0f) so explicit clipping/generating new vertices and handling all the additional vertex attributes is not needed. In reality, there is no mat3::inverse() or even per-vertex attribute bary calculation so it fits rather easily and elegantly to the rest of tri. setup. The original paper I link there explains greatly how for HW the gains can be even bigger.
- ggambetta 8y agoSuper interesting, thanks :) My rasteriser is admittedly optimised for requiring the most basic math possible, as it's mostly an educational resource.
- NotCamelCase 8y agoNo problem! You've got some great resources there too! :) I had problems running some demos though.
- ggambetta 8y agoHmm, mind telling me which ones, which browser, etc? My contact info is in my profile if you rather do this privately.
- vardump 8y ago> That's cool! Although I'll take linear code with bunch of matrix-vector products over bunch of branches any day :-) Any day? Even on those days when you need to use say, 80486 or 68000? Or some low-end microcontroller?