- cross-posted to:
- godot@lemmy.ml
- gamedev@lemmy.ml
- godot@programming.dev
- cross-posted to:
- godot@lemmy.ml
- gamedev@lemmy.ml
- godot@programming.dev
I just started a new project about a week ago. I guess it’s time to port it.
I just started a new project about a week ago. I guess it’s time to port it.
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.
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 (
Camera3Dprovides 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.