Open mattrdowney opened 5 years ago
I think there is a real (and statistically inevitable) chance that a straight vector graphics line is generated, and when the mesh is being morphed it will create too little detail (and possibly cause the sphere to look e.g. like a hemisphere because of the missing detail). Equator lines seem like a possible reason that would happen.
Coding this generically, so that multiple formats can be used/tested might be a good idea (or over-engineering?)
In order to avoid detail issues, the best solution is to recursively subdivide triangles in 4 when their max edge length exceeds some threshold.
Notably, this distance is before wrapping it into a sphere.
Actually, the distance is harder to compute (the circle texture's distances are only accurate towards the center). You probably want to compute distance afterwards (with a notion of direction to figure out if the arc went around the sphere).
Also, there are three good algorithms (cube, polar coordinates, octahedron) - like I originally thought.
Octahedron probably has the best precision for a single vector graphic (while maintaining ease of implementation).
The issue with a polar coordinates / world lotus is that the south pole / distant fringes get a (infinitely) disproportionate amount of detail.
There are a couple of new possibilities using Unity's scalable vector graphics support.
Generally, there are two possibilities:
1) render to a single plane which gets folded like flower petals into a sphere. 2) render as a cube which gets sphere-ified.
I need to grab a callback when the vertices are being generated to reconstruct a mesh that is a sphere. If I can get option 1 working, that's great because the seam/discontinuity is a single point. If option 2 is necessary (or even worse, necessary and I cannot sphere-ify it), then there will be more pain to get things working as I want them (especially with efficiency concerns).
Builder patterns work better using Unity's new interface for constructing vector graphics at runtime, so I might just get rid of the concept of .pvg files #72 altogether (because they are redundant / overly complicated).