I just started a new project about a week ago. I guess it’s time to port it.

      • PorkrollPosadist [he/him, they/them]@hexbear.netOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        7 hours ago

        Problem was an array indexing miscalculation in my C++ code (many such cases). It failed silently in the old build, but triggered a segmentation fault in the new version.

        Screenshot of the new Godot 4.6 editor displaying a heightmap mesh.

        I’m trying to implement the CDLOD heightmap algorithm in a GDExtension. I’m pretty close. I need to implement the distance function (basically just log₂(distance)) and frustum culling (Camera3D provides methods which make this fairly trivial, and I already know the AABB of any arbitrary tile. The code which was failing was the bit that runs on leaf tiles to iterate the actually pixel data and find the Z-min/max. From there the min/max values just accumulate back upwards as the initialization function ascends out of the tree).

        It’s a pretty cool system (especially for it’s relative simplicity). I’m using a MultiMeshInstance3D to draw an arbitrary number of identical grid meshes. The same mesh is used regardless of the level of detail and simply transformed into the correct position / size. The tile boundaries are passed using INSTANCE_CUSTOM to the shader which applies the heightmap in the vertex stage, so the whole terrain can be rendered in arbitrary detail without making any changes to the rendering pipeline.