$ show BabylonJS/BabylonToolkit
BabylonToolkit is a comprehensive game development framework built on Babylon.js, providing a Unity-like scripting system with entity-component architecture. It includes a runtime library (babylon.toolkit.js) with components for scene management, physics (Havok), navigation (Recast/Detour), animation blending, tweening, object pooling, trigger volumes, custom shader materials, and UI export from Unity. The toolkit also offers editor plugins for Unity and Unreal exporters, shader material examples, and VSCode snippets for rapid prototyping. External dependencies include Babylon.js, Havok Physics, Recast/Detour, and Unity Editor. The architecture is a library with a central SceneManager and ScriptComponent lifecycle, plus optional shader plugins. Key entry points are the runtime script and the Unity exporter pipeline. The code shows high craftsmanship in areas like custom shader materials and tweening, but has risks of duplication in shader code and reliance on large binary Unity packages.
The LLM identified 2 files worth highlighting for reuse:
Provides a base class for creating custom shader materials in Babylon.js. It allows injecting vertex and fragment shader code via plugins, enabling advanced rendering effects. The class is self-contained and can be extracted to any Babylon.js project to build custom materials with minimal modification.
Implements a universal terrain material with multi-texture blending, normal mapping, and support for up to 4 texture layers. It generates both WGSL and GLSL shader code dynamically. While specific to terrain, the pattern of dynamic shader generation and texture blending is reusable for other multi-texture effects.