Welcome to RTTEngine a simple approach at a 3D Game Engine with a strong focus on Learning the complex field of computer graphics, applications of Mathematics and software engineering princples & optimization techniques.
| Metric | Value |
|---|---|
| Frame Time | 8ms (125 FPS) |
| Draw Calls | ~50 |
| Triangles | ~50K |
| Bone Upload | 0.007ms |
| Motion Search | 0.02ms |
Motion Matching
- SAH-optimized KD-Tree (12 bins)
- 10,980 pose database
- 0.02ms search time
- Continuous pose searching
Bone Matrix Buffer
- Auto UBO/SSBO selection
World Rendering
- Frustum culling
- Distance LOD
- Instanced rendering
- Occlusion culling
- Texture atlasing
Memory Management
- Memory arenas (O(1) allocation)
- Object pools (O(1) alloc/free)
- Asset manager with reference counting
Foot IK System
- Dynamic terrain height tracking
- Enhanced foot planting detection
- Real-time floor height updates
- OpenGL 3.3+ pipeline
- GPU skinning with bone buffer
- Batch rendering with instancing
- Multiple light types
- Normal mapping and PBR materials
- Skybox with cube mapping
- Atmospheric fog
- Procedural terrain (Perlin noise)
- Chunk-based LOD (4 levels)
- 800m ร 800m explorable areas
- Height-based biomes
- Water system with waves
- Vegetation placement
- Skeletal animation with GPU skinning
- Animation blending and layering
- Root motion extraction
- Foot IK
- State machines
- Mixamo compatibility
- FBX import via Assimp
- Collision detection (boxes, spheres, capsules)
- Rigid body dynamics
- Continuous collision detection
- Raycasting
- Constraints (hinge, slider, springs)
- Character controller
- Third-person movement with root motion
- WASD locomotion
- Jump, Sprint, Crouch
- Smooth rotation
- Camera modes: Fixed, Orbit, Follow
- Smooth zoom (8-30m)
- GPU Profiler (OpenGL timestamp queries)
- Foot IK Debug (Press G)
- Motion Matching Debug (Press H)
- Performance Stats (Press F1)
3D GAME ENGINE/
โโโ world/ # Terrain, chunks, vegetation
โโโ animationSystem/ # Animation, bone buffer, foot IK
โโโ motionMatching/ # Motion matcher, KD-Tree, database
โโโ boneSystem/ # Skeleton, bone naming
โโโ physicsSystem/ # Physics, rigid bodies, constraints
โโโ modelSystem/ # Model loading, meshes
โโโ playerSystem/ # Character controller
โโโ cameraSystem/ # Camera management
โโโ shaderSystem/ # Shaders, skybox
โโโ renderer/ # Renderer, texture atlas, GPU profiler
โโโ lighting/ # Light management
โโโ memory/ # Arenas, asset manager
โโโ components/ # ECS components
โโโ tests/ # Unit tests (235 total)
โโโ assets/ # FBX models, animations, skybox
โโโ include/ # GLAD, GLM, KHR
โโโ Makefile # Build configuration
โโโ test.cpp # Main entry point
โโโ bin/ # Executables
| Key | Action |
|---|---|
| W / S | Move forward / backward |
| A / D | Strafe left / right |
| SPACE | Jump |
| LEFT SHIFT | Sprint |
| LEFT CTRL | Crouch |
| C | Toggle camera mode |
| Mouse | Orbit camera |
| Scroll | Zoom (8-30m) |
| Q / E | Camera pivot |
| R | Reset camera |
| F | Toggle wireframe |
| B | Bone debug |
| G | Foot IK status |
| H | Motion matching debug |
| F1 | GPU stats |
| ESC | Exit |
| Library | Installation (Ubuntu) |
|---|---|
| GLFW | sudo apt install libglfw3-dev |
| GLM | sudo apt install libglm-dev |
| Assimp | sudo apt install libassimp-dev |
| OpenAL | sudo apt install libopenal-dev |
| zlib | sudo apt install zlib1g-dev |
| Google Test | sudo apt install libgtest-dev |
GLAD is included in include/.
# Debug build
make
# Release build
make release
# Run tests
make test
# Run engine
./bin/runโ
Compilation: SUCCESS
โ
Tests: 230/235 PASSING (98%)
Total Tests: 235
Passed: 230 (98%)
Disabled: 5 (2%)
Failed: 0 (0%)
| Suite | Tests | Status |
|---|---|---|
| Animation | 17 | โ |
| Animation FSM | 20 | โ |
| Camera | 77 | โ |
| Character Controller | 24 | โ |
| Integration | 19 | โ |
| Math | 19 | โ |
| Memory Management | 25 | โ 22 passing |
| Motion Matching | 14 | โ 12 passing |
| Physics | 13 | โ |
| Terrain | 7 | โ |
| Metric | Value |
|---|---|
| World Size | 800m ร 800m |
| Active Chunks | 45-70 |
| Total Vertices | ~50K (with LOD) |
| Max Trees/Chunk | 80 |
| Frame Time | 8ms (125 FPS) |
| Motion Search | 0.02ms |
| Bone Upload | 0.007ms |
- Procedural terrain generation
- Chunk streaming & LOD
- Frustum & occlusion culling
- Animated water system
- Vegetation instanced rendering
- Skeletal animation
- Motion matching system
- Bone matrix buffer (UBO/SSBO)
- Foot IK with terrain tracking
- Physics collision detection
- Rigid body dynamics
- Character controller
- Camera system
- Texture atlasing
- GPU profiling
- Memory arenas & pools
- Asset manager
- Unit tests (235 tests)
- NaN prevention
- Grass instanced rendering
- Rock model rendering
- Texture splatting
- Water collision
- Shadows
- Full audio integration
- Infinite terrain streaming
- Day/night cycle
- Weather system
- Advanced lighting
- Particle system
- UI system
- Scripting support
Edit in test.cpp:
// Terrain
terrainConfig.chunkSize = 100.0f;
terrainConfig.viewDistance = 8;
terrainConfig.lodDistance = 50.0f;
terrainConfig.heightScale = 80.0f;
// Vegetation
vegConfig.treeDensity = 0.02f;
vegConfig.maxTreesPerChunk = 80;
// Camera
cameraDistance = 15.0f;
cameraHeight = 5.0f;
cameraZoomMin = 8.0f;
cameraZoomMax = 30.0f;
cameraFollowSmooth = 60.0f;
// Motion Matching
mmConfig.maxSearchResults = 10;
mmConfig.searchRadius = 2.0f;
mmConfig.blendDuration = 0.1f;- Grass instanced rendering not fully integrated
- Some FBX animations need retargeting
- Rock models need proper LOD
- Press G to check foot IK status
- Press H to check motion matching state
- Press F1 to profile performance
- Fork the repository
- Create a feature branch
- Write tests for new features
- Submit a pull request
- Open issues for bugs or features
MIT License โ See LICENSE file for details.
| Resource | Purpose |
|---|---|
| Mixamo | Character animations |
| Assimp | Model loading |
| GLFW | Windowing |
| OpenGL | Graphics API |
| GLM | Mathematics |
| Google Test | Unit testing |
| Papers & textbooks | techniques & experimentation |
Low FPS
Press F1 to see GPU stats, identify bottleneck
Character floating
Press G to check foot IK, verify floor height
NaN errors
Check character/terrain initialization order
Black screen
Check shader compilation, verify asset paths
- Press F1 - Check GPU stats
- Press G - Check foot IK
- Press H - Check motion matching
- Check console for errors
- Run tests:
make test