Im generating procedural “Pies” for a PieChart plotter. My idea is to procedurally generate the necesary pie slices for the chart once, an then animate their vertex via Shader through vertex offset.
This is the desired effect, without the flicker
My problem is that the pie appears to be perfectly formed (all tris pointing outwards, as they should), but when applying vertex offset and the mesh is at certain angles some polygons are missing ( for example rot x0y0z0 == missing top & bot caps).
I have checked & rechecked my math and i believe is correct, and it actually renders correctly in some angles.
I thought it could be due to Bounds scale but it tried pushing it to 100 and still no change.
Two-sided doesnt work either, so i think is not that the polygons get backwards or anything.
this procedural pie is generated by generating 2x 2D Arcs at different heights, then joining them by the sides. Caps and Sides vertex are duplicated because i didnt know how to make split-vertex-normals on ProceduralMeshComponent, so each part (top cap, bot cap, side) is a Section.
This is the shader SHADER PASTEBIN
The material takes the local position for each vertex and deduces its corresponding angle in a unit circle, then lerps that angle towards 0 and recalculates the vertex position. It also corrects the normal orientation to match the offset.
I cant think of anything that could cause this behaviour, if someone could offer some thoughts would be greatly appreciated. Ask me for any extra information, thanks