208 points · by adamnemecek · 6y ago · 80 comments
Both are closed source, but there are evaluation version available, if someone is interested in compare rendering quality and speed.
If using CSS with SVG is important then it’s actually better to use a backend with a library like librsvg (e.g. Cairo) then run node-canvas on top of it like automattic does. Even Inkscape has problems with CSS in SVG files. CSS in browsers is subjective because nowadays they might be using an style that doesn’t have a straightforward approach that can be rasterized. I haven’t had much luck with rasterizing SVG styles past CSS2 spec.
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Hea...
https://developers.google.com/web/updates/2017/04/headless-c...
and in dev panel https://developer.mozilla.org/en-US/docs/Tools/Taking_screen...
Is that what you’re looking for?
No?
So someone somewhere is going to need to rasterise your vectors if you want to see them on a screen, aren't they?
That's the class I'm currently taking.
If you like ray tracing, Cem Yuksel currently teaches most of the related courses at Utah [2].
One of the first projects I "assigned" to myself when learning to program was to create a 3d environment and be able to scale, rotate, translate objects in 3d. It was easy and fun because I got to choose the language, the rules, etc.
This assignment makes me cringe a bit because there are a lot of hoops to jump through. But yeah, I guess, no pain no gain or something like that :)
You can also just go to any university website yourself and compare their syllabi and see how different they are.
My friend tried to get a CS degree at Pepperdine and the curriculum was 15 years out of date. To students who are new to the field, it is hard to figure out where to start even if they could do it independently.
For an example of a rasterizer, you can take a look at my pure JS implementation of canvas (which is roughly the same imaging model as SVG). All lines and shapes are flattened into a pure line polygon, then drawn with a scanline rasterizer. Getting the basics working is fairly easy. Handling the endless edge cases, however.... :)
https://magcius.github.io/xplain/article/rast1.html
The edge cases are similar -- precision in computing the path intersections and winding curves.
You have to do things like stencil texture to speed things up etc etc.
Text rendering can be tricky, but not that much trickier -- it's just the same curves at smaller scales.
Not sure what you mean by stencil textures. Are you talking about the NV_path_rendering approach where you stencil out the path? Yeah, that's not really a thing that people do these days.
[0] https://blog.mecheye.net/2019/05/why-is-2d-graphics-is-harde...
You can builds all kinds on top of pixels and triangles.
What you are saying is outdated by maybe a couple of decades.