MIT License

技术解读

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

Atlas-Engine 深度技术分析

项目背景与痛点

在计算机图形学和游戏开发领域,一个能够跨平台且支持物理基础渲染(Physically Based Rendering,PBR)以及硬件/软件光追技术的渲染引擎始终是开发者和研究者的共同追求。既有的大多数渲染引擎往往在跨平台能力或对现代渲染技术的支持上有所欠缺。tippesi/Atlas-Engine 项目正是为了解决这一市场痛点而设计的。它不仅追求极致的光追效果,还提供了跨平台的技术支持,使得开发者能够在不同操作系统和硬件平台上高效地进行渲染开发。

核心技术揭秘

Atlas-Engine 的核心在于其实现了对物理基础渲染(PBR)和光线追踪(Ray Tracing)的支持。其整个技术栈中,C++ 语言依然是编写底层高性能逻辑的首选,而 OpenGL(或 Vulkan,取决于目标平台)则用于抽象了硬件差异,提供了统一的渲染接口。在光线追踪方面,Atlas-Engine 可以选择硬件加速的解决方案,比如利用 NVIDIA RTX 系列显卡的专用光追单元,或者选择采用 CPUs 作为另一种软件光追实现。

架构层面,此引擎采用了模块化设计,以适应不同平台与硬件的多样化需求。下图展示了 Atlas-Engine 的主要模块及其数据流情况。

graph TD A[用户输入] --> B[引擎初始化] B --> C{"创建窗口"} C -->|"成功"| D[启动事件循环] C -->|"失败"| E[错误处理] D --> F[渲染命令注入] F --> G[光线追踪处理] G --> H{"硬件加速?"} H -->|"是"| I[GPU光追] H -->|"否"| J[CPU光追] I --> K[输出帧] J --> K[输出帧]

在设计模式上,Atlas-Engine 采纳了观察者模式(Observer Pattern)来处理渲染过程中不同组件间的事件通知,确保系统的灵活性和组件间的解耦显著提高。而其数据流设计也明显倾向于把绘制命令和渲染结果的生成、处理分布在不同的线程中完成,以提高整体的执行效率。

功能亮点与差异

与其他渲染引擎相比,Atlas-Engine 最具吸引力的特点是其对光线追踪的支持。此外,其模块化的设计思路确保了项目的可扩展性,即开发者可以根据具体需求自定义渲染流程。而且,良好的文档支持和活跃的社区也为其带来了不少附加价值。

应用场景与落地建议

上述优点使 Atlas-Engine 适用于那些追求高级视觉效果的游戏、建筑可视化乃至实时数字孪生平台等场景。然而,在生产环境使用时我们需要特别留意到的一些点包括:开发和维护的成本较高,尤其是针对跨平台兼容性和硬件加速的复杂性需要有专业背景的技术团队进行支持。此外,随着渲染任务负载的增加,系统性能瓶颈也可能逐渐显现,此时建议对关键路径进行性能优化。

综合评价

总之,Atlas-Engine 是一个出色的跨平台物理基础渲染及光追渲染引擎,不仅具备高级渲染技术的支持,同时也注重灵活性和可扩展性。当然,选择其作为开发工具也需充分考虑自身的实际情况,包括技术团队的综合能力、预期项目的业务需求等。在合适的场景下使用 Atlas-Engine,无疑将极大地提高产出效率,带来高质量的视觉体验。

关于

GitHub 原始描述(英文)

Cross platform toy render engine supporting physically based rendering and hardware/software ray tracing

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

语言占比

Batchfile
C
C++
CMake
GLSL
Lua
PowerShell
Shell

Release

README

Atlas Engine

The MIT License Code quality Latest build

GI scene
Realtime Sponza scene with raytraced GI, AO and reflections (model from Intel Graphics Research Sample Library)

Introduction

This is a cross platform toy engine developed in my spare time that is available on Linux, Windows and MacOS.

Note: The current version (0.2.0) contains many API changes and is still an active WIP

Requirements

  • Vulkan SDK
  • C++20 compatible compiler
  • CMake
  • Vcpkg

Set up

Dependencies are managed through vcpkg. You can either install the packages manually or while doing the build configuration with CMake. To use vcpkg together with CMake follow the steps described here.

Compiling the demo application

Run CMake with the option ATLAS_DEMO=ON to include the demo application in the project. For easier use, the vsbuild.bat does exactly that and launches Visual Studio afterwards. After launching the IDE, set AtlasEngineDemo as your target.

Including the library into your own project

It is possible to compile the engine either as a shared or static library. Set the ATLAS_BUILD_SHARED option accordingly. To make the library work with its dependencies, the root CMakeLists.txt of this repository has to be added as a subdirectory. As an entry point to create an application from scratch take a look at the Hello World tutorial. For reference, the source folder contains an empty app header and an empty app source.

CMake build options

  • ATLAS_BUILD_SHARED Force project to be build as a shared library
  • ATLAS_EXPORT_MAIN Export the main file to be added as executable to parent project (only if main function cannot be found)
  • ATLAS_NO_APP Disables the engines main function and app functionality. You have to code the main function and initialize the engine yourself
  • ATLAS_IMGUI Enables the ImGui integration. Is enabled by default if the demo project is build.
  • ATLAS_ASSIMP Enables the Assimp integration. Is enabled by default.
  • ATLAS_HEADLESS Enables the headless support, which means no window needs to be created. Is disabled by default.
  • ATLAS_BINDLESS Enables support for bindless resources. Might be problematic on MacOS. Enabled by default.
  • ATLAS_TESTS Generates the testing project and allows to target it.
  • ATLAS_BUNDLE Allows the applications to be bundled and installed on MacOS. Disabled by default

Documentation

If you want more information have a look into the Documentation.

License

The source code is licensed under the MIT license. The copyright notices of the dependencies can be found in the LICENSE.md file in the dependency directory.

Note: The files in the data folder (except the shaders) use a different license.

Code Example

For a code example have a look at the demo application.

Latest executables

The latest non-release executables can be found in the latest run of the build pipeline. They contain both the demo application and the editor.

Screenshots

Editor Sponza demo scene opened in the editor Example scene Rasterized image using real time global illumination Example scene Path traced scene Island scene Island demo scene using the terrain and ocean systems

评论

暂无评论