- // Set soft anti-alias range at most 2% of visual size
- gPotentialRange = min(1.0, max(vRectSize.x, vRectSize.y) * 0.02);
+ // Set soft anti-alias range at most 10% of visual size.
+ // The range should be inverse proportion with scale of view.
+ // To avoid divid-by-zero, let we allow minimum scale value is 0.001 (0.1%)
+ gPotentialRange = min(1.0, max(vRectSize.x, vRectSize.y) * 0.2) / max(0.001, max(uScale.x, uScale.y));