C++ game engine combining opensource libraries & tools that I like
currently using:
- bgfx as the renderer
- CMake as the build system
- vcpkg as the package manager
- glm for 3d math
- EnTT as the entity component system
- assimp for generic asset loading (not in runtime)
- sol2 modern C++ bindings for lua
- nlohmann-json for parsing json
- pugixml for parsing xml
- imgui for editor UI
- RmlUI for ingame UI
- ozz for 3d skeletal animations
- cereal for serialization
- Jolt for 3D physics
- miniaudio for audio
- taskflow for multithreading
- tiny-process-lib to run os processes
- mikktspace - to calculate tangents
- middleclass - small object orientation lua lib
planned to use:
- tracy for frame profiling (blocked because of bgfx#3308 and the vcpkg bgfx build not having a profiler feature)
- recast navigation for pathfinding
- BehaviorTree.CPP for behavior trees
- Box2D 2D physics
- ldtk for 2D level editor
- spine for 2d skeletal animations
Trying to target the following platforms:
- desktop (windows, macos, linux)
- mobile (iOS, Android) (pending)
Some philosofical decisions (could be controversial)
- use modern C++ (20) patterns where possible
- use as much stl as possible (need to look into memory management at some point)
- no naked pointers
- throw exceptions for error handling
- try to keep the API similar to Unity3D (where it makes sense) so that it's easy to port game logic
WARNING: currently in early stages of development
- Will it have feature X?
Depends on what I need. Anyone is welcome to fork and submit PRs.
I'm still learning CMake, so if you see something that should be fixed please let me know.
- bgfx window setup (GLFW on windows & linux)
- update logic methods with delta time
- renderer
- point, spot, directional & ambient lights
- forward render
- unlit, gui
- basic phong
- PBR metallic-roughness
- cascaded shadow mapping
- spot & point light shadows
- camera culling (frustum, occlusion seems to be broken)
- entity component scene using entt
- transform, camera
- type filtering
- serialization
- lights
- free look
- sprites and spritesheets
- loading models using assimp (FBX, gltf, etc...)
- serializing models from assimp into binary using cereal
- lua scripting
- lua debugging
- coroutines similar to unity
- multiple UI options
- imgui for tooling
- RmlUI for ingame (support for multiple canvases)
- skeletal animations using ozz (reading from binary)
- 3d physics using jolt
- rigidbodies
- character controller
- tool to export asset folders
- shaders & vertex layouts
- copy files
- assimp to custom binary model format
- ozz skeleton & animations
- dynamic font texture generation
- play sounds and music (wav & mp3)
- frame limiting
- more renderer features
- bloom
- deferred, clustered
- SSAO
- luajit support (maybe compile using importer)
- text improvements
- finish all the TextRenderConfig options
- dynamic distance field rendering with border support
- clipboard text support (UTF8)
- asset loading progress (maybe implement progressive loading)
- possible refactors
- maybe replace Data for std::vector<uint8_t> and DataView for std::span<uint8_t>
- loaders should return unique_ptr
- move lua bindings to separate library?
- C++ coroutines could be useful in some places
- more stuff serialization
- binary texture atlas
- material
- custom UI module (rmlui is nice but slow)
- fix occlusion culling
- more unit tests
- performance profiling
- 2d physics
- instancing
- 3d physics materials
- multithreaded updates (Ubisoft)
- support multiple imgui app components with different transforms
- spine animations
- unify use of allocators everywhere
- progressive asset loaders
- lua debugging would be nice
- particle systems (maybe effekseer)
- more sound options (spatialization, effects)
- animation root motion
- openusd scene format support
- a game editor would be a huge undergoing, but maybe using wxWidgets
- SuperNovaEngine a very similar engine but much more advanced
- Cluster - PBR shaders for bgfx
- dome engine - minimalist engine with wren as the scripting language
- RaZ engine - C++17 game engine
- meshoptimizer
- forward+ - description of tiled forward renderer in DirectX 11
function init()
local program = Program.new(StandardProgramType.Forward)
local scenes = app:add_component(SceneAppComponent)
local scene = scenes.scene
local camEntity = scene:create_entity()
local camTrans = camEntity:add_component(Transform, { 0, 1, -1 })
camTrans:look_at({ 0, 0, 0 })
local cam = camEntity:add_component(Camera)
cam:set_viewport_perspective(60, 0.3, 1000)
cam:add_component(ForwardRenderer)
cam:add_component(LightingRenderComponent)
local lightEntity = scene:create_entity()
lightEntity:add_component(AmbientLight, 0.2)
lightEntity:add_component(Transform, { 1, 1, -1 })
local light = lightEntity:add_component(PointLight, 2)
light.radius = 5
local mesh = MeshData.new_sphere():create_mesh(program.vertex_layout)
scene:create_entity():add_component(Renderable, mesh, program, Color.green)
end