mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
45d1690f6e
Previously, we were using a normalized 8-bit unsigned integer which forced us to represent each increment of the winding number as a fraction of the max value (1 / 255) which we would then add up using additive alpha blending. This had three major drawbacks: - The max winding number could not be greater than 255. - Adding up (1 / 255) several times could result in a loss of precision. - Due to also computing anti-aliasing as a fractional winding number, we had to reduce the max winding number to 32. This was still not good enough because we would multiply a fractional value with `1 / 32`, thus introducing more and more loss of precision. This commit changes the texture type to an `f16` which doesn't require the division by 255 and enables greater precision in the computation of the anti-aliased parts of a curve. Note how this also removes the limitation of 255 windings at most per curve. The tradeoff is paying twice as much memory for storing the texture, but that seems totally valid to achieve rendering accuracy. Note that this kind of texture should be compatible with WebGL2 once we start working on a web version of Zed. |
||
---|---|---|
.. | ||
examples | ||
grammars/context-predicate | ||
src | ||
build.rs | ||
Cargo.toml |