Recently, a lot of fantastic research on 2D rendering has appeared. Peter Kobalicek and Fabian Aizerman are working on Blend2D
: this is one of the fastest and most accurate CPU rasterizers on the market, with innovative JIT technology. Patz Walton of Mozilla studied not one, but three different approaches in Pathfinder
, culminating in Pathfinder v3. Raf Levien built the computing pipeline
using the technology described in a scientific article by Ghana with colleagues on vector textures (2014)
. It seems that some distance development is marked by distance fields: Adam Simmons
and Sarah Frisken
independently work here .
One might ask: why is there so much noise around 2D? It can't be much harder than 3D, right? 3D is a completely different dimension! Here we have real-time ray tracing on the nose with accurate lighting, and you can’t master the plain 2D graphics with solid colors?
For those who are not very well versed in the details of the modern GPU, this is really very surprising! But 2D graphics have a lot of unique limitations that make it extremely difficult. In addition, it does not lend itself to parallelization. Let's take a walk along the historic path that brought us here.
In the beginning there was a plotter. The first graphic device capable of interacting with a computer was called a “ plotter
” (plotter): one or more pens that can move around paper. Everything works according to the pen-down command, then the drawing head moves in some unique way, possibly along a curve, and the pen-up command is received
. HP, the maker of some of the earliest plotters, used a BASIC variant called AGL on the host computer, which then sent the plotter commands in another language, such as HP-GL
. In the 1970s, graphic terminals became cheaper and more popular, starting with the Tektronix 4010
. He showed the image using a CRT, but do not be fooled: this is not a pixel display. Tektronix came from the industry of analog oscilloscopes, and these machines work by controlling the electron beam along a specific path
. Thus, the Tektronix 4010 did not have pixel output. Instead, you sent him commands in simple graphic mode
, which could draw lines, but, again, in the "feather down", "feather up" mode.
As in many other areas, everything changed the invention of Xerox PARC. Researchers began to develop a new type of printer, more computationally expressive than a plotter. This new printer worked in a small stacked Turing-complete programming language similar to Forth, and it was called ... Interpress
! Obviously, Xerox could not find him a worthy application, so the inventors left the ship and founded a small startup called Adobe. They took Interpress with them, and as they were corrected and improved, it changed beyond recognition, so they gave it another name: PostScript. In addition to the sweet, turing-complete stack language, the fourth chapter of the original PostScript Language Reference
describes the Imaging Model, which is almost identical to modern programming interfaces. Example 4.1 from the manual contains sample code that can be translated almost line by line into HTML5