TextureMind Framework – Progress #31 – Animation system and more

The framework has seen many advancements over the years: improved Wayland support on Linux; a 3D engine on Raspberry Pi 5; hardware video encoding/decoding on MacOS; and improved file system management. One of the most notable improvements is the animation system and template management for 3D objects. Until now, the framework had a draft animation system that could animate a skinned mesh with the GPU, without the ability to choose sub-animations. All sub-animations were scrolled forward, and only one mesh could be animated at a time. This feature was added many years ago, for demonstration purposes only. This is because the framework has been used for years to develop other types of applications, where the 3D engine played no role. Recently, development has taken several directions, including finalizing the 3D engine, developing missing parts, and developing applications that use it. I have now completed the animation system, implementing a full-fledged animation system. You can now animate multiple skinned meshes at once, select sub-animations, handle animation events with a callback system, and animate in a single run, loop, forward, and backward.

Nessuna descrizione alternativa per questa immagine

Another major shortcoming was the template and instance management system. In my 3D Engine, a 3D object can be an instance of a 3D template, which is therefore a copy of it. These instances can be identical copies of the object or slightly modified copies, allowing for a different appearance. The instantiation system is used not only for 3D, but also for 2D, such as managing widgets in the GUI. A major limitation concerned the complete copy per instance of a template, which is a skinned mesh: if a skinned mesh is composed of 50,000 polygons, drawing 100 copies of it on the screen meant having to create 5 million polygons, both 3D points and vertex attributes, to draw the mesh, with an incredible waste of system and GPU memory. I've now solved this problem, so creating even editable instances of a template doesn't create any in-memory copies of the polygons and the mesh slices: this required a difficult refactoring of the animation system, but it was absolutely worth it. Now you can create thousands or tens of thousands of copies, without impacting memory, but only drawing times. The next step will be to further optimize the process, avoiding even minimal copies for non-editable instances and implementing an impostor system to draw arrays of instances directly with the GPU. This would allow the drawing of millions of animated skinned meshes, like in war simulators.

Leave a Reply