Posts

Showing posts from August, 2024

Mesh rendering is difficult!

Meshes are composed of meshlets, with one meshlet for each material in the mesh. Meshes are rendered one meshlet at a time, and meshlets should be batched by material. Meshlets with matching buffers and material should be instance-rendered. Materials should not need to be recompiled to take advantage of instanced-rendering. Meshlets need to be conditionally-excludable to support culling. Depending on the application, mesh rendering will sometimes be in the application's simulation thread, and sometimes it will not be! The vast majority of meshes instances will remain unchanged each frame, and there will be *a lot* of meshes, so an optimization to make those nearly free would be very beneficial. Meshlet batches sharing materials should be rendered in sequence to save shader-program switching time. Mesh rendering is a fundamental unit of 3D applications, and it is something I don't want to reimplement for each 3D program I build. I want to make it as self-contained as I can. NOTE...

Thoughts about test code

 For the most part, tests pass. When tests fail, they require inspecting the source of the failing test or the source of the failing tested code. Test harnesses are a pain to implement, and I usually end-up writing very-specific test asserts for each library anyway to the point where the harness is a waste. The harness also becomes a ubiquitous public dependency! Wouldn't it be better to write test functions as libraries that can just be called from a main test application? Like, how hard would it be to just call the test functions somewhere?