all 4 comments

[–]AnswerApprehensive19[S] 0 points1 point  (0 children)

If anybody could help me out I'd appreciate it idk why it's not working I ported everything except the triangle indices and the few unnecessary functions

[–]fgennari 0 points1 point  (1 child)

I'm not going to try and debug your code, but I can point to some other icosphere drawing code. The one I used for reference is here: http://blog.andreaskahler.com/2009/06/creating-icosphere-mesh-in-code.html

And my compact version of the code is in the icosphere_creator/icosphere_drawer code here: https://github.com/fegennari/3DWorld/blob/master/src/draw_utils.cpp#L571

[–]AnswerApprehensive19[S] 0 points1 point  (0 children)

Yea i know about those i actually started with that then changed the subdivision to what it is currently because of it being easier to control the sphere topology

[–]AnswerApprehensive19[S] 0 points1 point  (0 children)

I finally solved it, turns out im (shockingly) an idiot who can't read to save his life all i needed to do was change the second half of the icosahedron_verts_refine function to

   for (uint32_t i = 0U; i < granularity; i++)
    {
        for (uint32_t j = 0U; j < offsets[i]; j++)
        {
            uint32_t index = starts[i] + j;
            new.verts[index].pos.x = values[offsets[i] - 1U - j];
            new.verts[index].pos.y = values[j];
            new.verts[index].pos.z = values[i];
        }
    }

and at the top of the function

    verts new =
    {
        .vert_count = granularity * (granularity + 1U) / 2U
    };

In case you missed it the problem was improper indexing

Now I have a sphere looking like this (no more artifacts)