Great post on spectral rendering, and a wonderful blog in general: momentsingraphics.de/SpectralRend...
Posts by Alexandru Ică
The source is a highly interesting read: hal.science/hal-02143706...
One thing I love about digging into rabbit holes such as PDF parsing is stumbling upon phrases like "schizophrenic PDF files".
"calculatorElement" and Annex F in this doc: color.org/specificatio...
Fun fact: new ICC profiles can contain embedded programs in them that specify color space transforms. All operators describe operations performed on the stack, à la Forth.
I wrote a new post about one of the weirdest optimizations I've done at one of my previous jobs. It was fun to explore, hopefully it's just as fun to read. :)
minus-ze.ro/posts/unintu...
The code for computing winding for a quadratic Bézier can be simplified a lot by dealing with monotonic quadratics only. Testing if a sample lies to the left/right of the curve becomes extremely cheap in that case.
"Quadratic Approximation of Cubic Curves" contains a neat method of representing one cubic Bézier as two C1-continuous quadratics, maintaining tangents at the endpoints. Combining that with a heuristic for how many times to split the source curve gives excellent results.
Not sure how relevant this is, but a few chapters from the CG Cinematography book by Chris Brejon about colors seem like a great reference:
- chrisbrejon.com/cg-cinematog...
- chrisbrejon.com/cg-cinematog...
- chrisbrejon.com/cg-cinematog...
I ported my demo to Rust to see if I can make things faster. The goals is to perform queries for arbitrary points and arbitrary vector paths, as fast as possible. I'll try to write everything SIMD-friendly.
> I’m glad I worked on this headless rendering test, but I had enough trouble making my code working headless that I want to look for an easier approach next time.
Sums up my experience with headless testing graphics. :)
Demo: editor.p5js.org/AlexandruIca...
I've implemented non-zero fill for quadratic curves without flattening them. Should be numerically robust but I haven't tested it too thoroughly yet. Very happy with the results so far. Coverage is computed per pixel individually.
Today I remembered that C syntax can be funny beyond typedefs:
int some_function(int input[static 100]);
This is valid C. And it tells the compiler that `input` has at least 100 elements.
www.inf.usi.ch/hormann/pape...
I'm reading some older blog posts regarding boolean path ops, and I found a great paper in the process. It's short, to the point, and contains intuitive explanations and figures. “Efficient clipping of arbitrary polygons” by Günther Greiner and Kai Hormann.
Is there any library that can be used to generate PDFs that contain transparent images? Ideally with a transparency mask. PDFLib and iText seem like valid options, but I'm wondering if there's any open-source alternative for this.
This is how it works in Skia in case anyone's curious: www.youtube.com/watch?v=Omfl...
Basically instead of doing union(union(p0, p1), ...) I did union(union(p0, p1, p2, ...), ...). I think this is a textbook example of an optimization that's completely unintuitive when you look at it. Unless you're familiar with how `union` works it makes no sense.
I'm using Skia to perform union on potentially a very large number of paths. On a particular case where I had around 2k paths, I saw that after the first ~1.5k it started to get increasingly slower.
Performing basic divide et impera made the whole thing run ~13x faster.