That's interesting! Do you have any references (or links to sample fragment shader code) for that quadratic case coordinate transformation?
That's interesting! Do you have any references (or links to sample fragment shader code) for that quadratic case coordinate transformation?
Basically, all quadratic Bezier curves are just linear transformations[0] of the curve u^2 - v. The fragment shader just evaluates that one equation to draw the curve, and texture mapping does all the rest. As long as you're careful to ensure that your fill surface polygon actually makes sense, you get back out perfectly-rendered Beziers at any zoom factor or angle.
[0] Scale/shear/rotate - all the things you can do by matrix multiplication against a vector. Notably, not including translations; though GPUs just so happen to use a coordinate system that allows linear translations if you follow some conventions.
> from a paper whose name I don't remember.
I guess it's the Loop-Blinn paper from my reply to the other reply.
Resolution Independent Curve Rendering using Programmable Graphics Hardware https://www.microsoft.com/en-us/research/wp-content/uploads/...
I found a reference on HN for anyone else following along:
> In 2005 Loop & Blinn [0] found a method to decide if a sample / pixel is inside or outside a bezier curve (independently of other samples, thus possible in a fragment shader) using only a few multiplications and one subtraction per sample.
- Integral quadratic curve: One multiplication
- Rational quadratic curve: Two multiplications
- Integral cubic curve: Three multiplications
- Rational cubic curve: Four multiplications
https://www.microsoft.com/en-us/research/wp-content/uploads/...