GNU Lesser General Public License v3.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

对于 “enginmanap/limonEngine” 项目的技术分析

项目背景与痛点

enginmanap/limonEngine 是一个 3D 第一人称射击游戏引擎,特点是支持全动态光照和阴影效果。在现有的游戏引擎领域里,虽然不乏强大的引擎如 Unreal Engine 和 Unity,但这些引擎往往偏重于易用性和全栈功能集成,而对于追求极致性能和定制化的高端应用,它们未必是最合适的工具。limonEngine 旨在填补这一空白,通过高度优化的渲染系统和模块化设计,满足专业开发者在复杂环境下的性能和定制化需求。

核心技术揭秘

技术架构

limonEngine 的核心架构可以分为几个主要组件,包括渲染引擎、物理引擎和资源管理器,每个组件都可以独立集成或定制,从而提供更高的灵活性。

graph TD subgraph "资源管理" A[资源加载] B[资源缓存] C[资源卸载] end subgraph "渲染引擎" D[着色器编译] E[光照计算] F[阴影映射] end subgraph "物理引擎" G[碰撞检测] H[物理模拟] end A --> B B --> C D --> E E --> F G --> H

实现原理

  • 渲染引擎:limonEngine 采用了基于 shader 的渲染管线,支持多种光照模型和阴影算法,保证了画面的真实感和视觉效果。例如,全动态光照系统,通过实时计算光照,确保游戏场景中物体的颜色和阴影随光源变化动态调整。阴影映射的引入,进一步提升了场景的真实度。

  • 物理引擎:碰撞检测和物理模拟的部分,limonEngine 采用高度可定制的模型,支持各种碰撞盒类型和高级物理效果,如弹性、阻尼等,为开发者提供充分的灵活性和控制力。

功能亮点与差异

limonEngine 的独特之处在于其原生支持全动态光照和阴影效果,这对于需要高真实性和沉浸感的游戏尤为关键。相较于竞品,limonEngine 更加注重性能优化和定制化能力,允许开发者深入底层进行优化和扩展。此外,limonEngine 支持跨平台编译和运行,降低了部署和维护成本,适用于多种游戏开发需求。

应用场景与落地建议

在生产环境中使用 limonEngine 需要了解其底层细节以进行充分的性能调优。对于中高端 3D 游戏开发,特别是重度依赖光照效果和物理模拟的项目,limonEngine 是一个值得考虑的选项。在充分配置和优化后,它可以显著提升游戏体验并提供更高质量的渲染效果。项目开发初期应密切关注文档资源和社区支持,充分利用 enginmanap/limonEngine 提供的强大功能和灵活性。

综合评价

limonEngine 以其卓越的渲染能力和定制化设计,为 3D 游戏开发者提供了独特且相对独立的解决方案。其优先考虑优化和性能提升的特点,使得它成为期望拥有高度自定义能力的项目开发者的重要选择。然而,定制化和灵活性也意味着更高的开发成本和自定义的工作量;此外,相比集成度更高的通用引擎,其社区和资源相对较少,可能对新手不够友好。综合来看,limonEngine 是一个兼具前沿技术和专业精神的优秀工程实践。

关于

GitHub 原始描述(英文)

3D FPS game engine with full dynamic lighting and shadows

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Batchfile
C
C++
CMake
Dockerfile
GLSL
HTML
Python
Shell

Release

README

LimonEngine

Limon is a multi platform 3D game engine mainly focusing on first person games. Focus of its development is ease of use and ease of study.

Feature Overview

  • Configurable node-based render pipeline editor
    • Automatically scans shaders, creates nodes using reflection
    • CPU side extension endpoint for stage setup/frame render/cleanup
    • Tag based filtering for targeting specific stages for specific objects
    • Multithreaded 4 Stage filtering including frustum and occlusion culling for the world per camera
    • All rendering is done by the same system
  • Shipping Rendering features
    • Cascaded shadowmaps, with optional staggering
    • Point shadow mapping
    • SSAO (including sample Render Method for CPU side)
  • Custom camera extension with both Perspective and Orthogonal projection
    • Samples for object attached camera, orthogonal player camera included
  • Software occlusion culling, for both Perspective and Orthogonal cameras
  • Rigid body physics
  • 3D spatial sound, music, and audio channels
  • Built-in editor with animation sequencer
  • Fully customizable Input system with gamepad support
  • Material editor
  • Automatic Navigation grid generation and multi-threaded pathfinding
  • Tracy profiler integration, including GPU stages, extensions, and an API for users
  • Tracy profiler server within the Editor, for quick glance
  • C++ and Python API for extensibility, and dynamic loading of extensions

For details check out the project web site

Prebuilt binaries for Windows, Linux and MacOS can be found here

Documentation is served on readthedocs

If you want to chat, we have a Discord channel

For a demonstration, check out the video :

0.6 Tech Demo

For features, check out features video:

0.6 featurette

Building from source on Ubuntu 26.04:

Step 1) Open Terminal, then copy and paste the following command

$ sudo apt install cmake git libassimp-dev libbullet-dev libsdl3-dev libsdl3-image-dev libfreetype6-dev libtinyxml2-dev libglew-dev build-essential libglm-dev

Step 2) Since GitHub is limiting LFS bandwidth, it is removed. Cloning the LimonEngine repository should also include all data needed:

$ git clone https://github.com/enginmanap/limonEngine.git && cd limonEngine && git submodule update --init

Step 3) Next, we need to navigate to the directory run cmake:

$ mkdir build && cd build && cmake ../ && cd ..

Step 4) Finally, we need to navigate to the build directory, make the source and copy the Data directory to the build directory:

$ cd build && make && cp -a ../Data .

Building from source on Windows

Windows platform is compiled using MSYS2. after installing MSYS2 as any Windows application, open up the msys2-terminal, and install the dependencies:

$ pacman -S cmake mingw-w64-x86_64-make mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb cmake mingw-w64-x86_64-assimp cmake mingw-w64-x86_64-bullet mingw-w64-x86_64-SDL3 mingw-w64-x86_64-SDL3_image mingw-w64-x86_64-tinyxml2 mingw-w64-x86_64-glew mingw-w64-x86_64-glm mingw-w64-x86_64-freetype

after that, you can use step 2 - 4 of Ubuntu instructions, on the same terminal.

Running

Start up:

  • Engine take a parameter as path of world to load
  • If no parameter passed, falls back to ./Data/Maps/World001.xml
$ ./LimonEngine ./Data/Maps/World001.xml

In Application:

  • Pressing 0 switches to debug mode, renders physics collision meshes and disconnects player from physics (flying and passing trough objects)
  • Pressing F2 key switches to editor mode, which allows creating maps.
  • Pressing + and - changes mouse sensitivity.
  • wasd for walking around and mouse for looking around as usual.

In editor mode:

  • All assets automatically scanned and listed. Can be filtered further by using filters widget
  • 3D object assets provide previews using world light information
  • Textures provide previews
  • Mass can be changed after object creation, both in editor and at runtime through the API; the engine swaps the collision shape (full mesh/baked vs convex hull) and re-registers with physics automatically. This has no effect on animated objects, which are always kinematic.
  • Inanimate objects are not allowed to have AI
  • You can create animations for doors etc. in editor. For animation creation, time step is 60 for each second.
  • When a new animation is created by animation editor, the object used to create the animation assumed to have this animation. You can remove by using the remove animation button.
  • You can create a perspective camera, attach to an object animated using the sequencer, and activate to have cut-scene or similar camera effects

Extending with C++ and Python

  • Limon Engine has 5 types of extensions:
    • Actions for triggers and buttons
    • AI for actors
    • Player for Input handling
    • Camera Attachment for custom camera behaviour (perspective and orthographic)
    • RenderMethod for custom GPU rendering primitives, wired into the render pipeline editor
  • All extension types are configured through the same unified parameter contract, and are usable from either C++ or Python.
  • The unified parameter automatically provides serialization, and editor interface, on top of communication with engine and other extensions
  • Engine tries to load custom C++ extensions from libcustomTriggers.dll for Windows, libcustomTriggers.so for GNU/Linux and libcustomTriggers.dylib for macOS. If you use an customisation in a map and library is missing, that customisation wont work, but rest of the map will. Python extensions are discovered from script files and require no separate library.

Details in the documentation

评论

暂无评论