Author Topic: Dropout Control  (Read 89 times)

PiotrGrochowski

  • Administrator
  • Newbie
  • *****
  • Posts: 4
    • View Profile
Dropout Control
« on: September 26, 2020, 06:27:35 pm »
The quadratic formula as estabilished in https://pixelbuilding.createaforum.com/quadratic-pixel-building/quadratic-formula/ is seen to properly handle half pixel borders.

But how does Drop Out Control does work? It's even more complicated than the Quadratic Formula. TD renderer 1.0 got it completely wrong, and TD renderer 2.0 improved it TD renderer 3.0 fixed some bugs too. The Pixel Building community is currently unaware of the exact specific Dropout Control method that should be used to properly render.

This is what came up with:

1. Track fractional edge positions in a fractional format while doing Quadratic Formula
2. Keep track of eight pixel arrays, assume extending up to 2 pixels from any standard render bounds, clamp any stored edges to one pixel beyond render bounds (2, 4, 5, 6, 7, 8, a, b)
3. clear 2, 4, a, b with the zero value
4. for each top edge (starting from the last one) increment the value in the array 2. if the value is 1 set the value in array 5 to the difference between fractional and integer values
5. for each bottom edge (starting from the last one) increment the value in the array a. if the value is 1 set the value in array 6 to the difference between fractional and integer values
6. for each left edge (starting from the first one) increment the value in the array 4. if the value is 1 set the value in array 7 to the difference between fractional and integer values
7. for each right edge (starting from the first one) increment the value in the array b. if the value is 1 set the value in array 8 to the difference between fractional and integer values
8. for each pixel from top to bottom from left to right if the value in arrays 4 and b if neither of the two pixels next to the edge if no stub detection or there exists any of the three edges next to the edge on either side if smart dropout control and the fractional edge is closer to the right pixel but not exceeding standard glyph bounding square subtract 2 from the pixel to the right of the edge else subtract 2 from the pixel to the left of the edge
9. for each pixel from top to bottom from left to right if the value in arrays 2 and a if neither of the two pixels next to the edge if no stub detection or there exists any of the three edges next to the edge on either side if smart dropout control and the fractional edge is closer to the up pixel but not exceeding standard glyph bounding square subtract 2 from the pixel to the up of the edge else subtract 2 from the pixel to the down of the edge
10. free 2, 4, 5, 6, 7, 8, a, b

But this is unfortunately an unworkable system for proper dropout control! This is because it does not properly handle some cases when dropout is close to the middle.

Please do note the dropout control system is dependent on the point order. The reason is depending on the point order the dropout control finds a different pair of edges out of more than two possible edges and this makes the smart dropout direction differ.

Also note that there are many renderers not properly using this dropout control mechanism. Edge dropout control glitching is when in FreeType it fails to properly parse dropout controls from top to bottom (as a drawn dropout control pixel affects the result of the dropout control pixels below it), and fails to make it properly dependent on the point order.
« Last Edit: September 27, 2020, 12:38:10 pm by PiotrGrochowski »

Share on Facebook Share on Twitter