MIT License

技术解读

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

EveryRay-Rendering-Engine 深度技术分析

项目背景与痛点

EveryRay-Rendering-Engine 是一款基于 DX11 和 DX12 的健壮的实时渲染引擎,针对快速原型设计而设立。该引擎的主要痛点在于,当前市面上的一些渲染引擎在高级图形特性方面表现得不够成熟,导致开发者在进行实时渲染项目时需要进行大量调试和优化,以满足高质量图形渲染的需求。EveryRay-Rendering-Engine 的出现,解决了开发过程中繁琐的底层图形实现问题,为开发者提供了一套完整的解决方案,使他们能够专注于渲染效果的研发,而不是底层技术的实现。

核心技术揭秘

EveryRay-Rendering-Engine 的核心在于其采用的技术栈和设计理念。引擎主要依赖于 DirectX11 和 DirectX12,结合多种先进的图形技术以实现高效稳定的渲染流程。为了更好地理解其内部架构,我们可以通过以下 Mermaid 图来概述其核心数据流:

graph TD A[用户请求] --> B("输入处理器") B --> C{"渲染类型?"} C -->|"实时渲染"| D("光线追踪模块") D --> E[绘制模型] C -->|"离线渲染"| F("光线缓存优化") F --> G[绘制模型] E --> H[显示更新] G --> H

该数据流图展示了 EveryRay-Rendering-Engine 底层的关键流程:

  1. 用户请求进入输入处理器,在这里进行必要的预处理。
  2. 渲染请求分成实时渲染和离线渲染两种情况。
  3. 实时渲染通过光线追踪模块进行所见即所得的绘制,离线渲染通过光线缓存进行优化。
  4. 不论是实时还是离线渲染,最终都在模型绘制模块进行最终处理,并将结果更新到屏幕上。

每一个模块都紧密配合,确保高效的渲染流程和优秀的图形质量。

功能亮点与差异

相比于市场上的同类产品,EveryRay-Rendering-Engine 的独到之处在于对 DX12 的支持以及其先进的光线追踪功能。这种双引擎的支持使得 EveryRay-Rendering-Engine 能够同时利用现代 GPU 的并行处理能力和 DX12 的低级性能,从内到外提供完备的解决方案。此外,EveryRay-Rendering-Engine 对光线追踪的支持不仅提升了图形的真实感,还降低了传统基于光栅化的渲染管线中的复杂度,为开发和测试真实光线交互的场景提供了便利。

应用场景与落地建议

EveryRay-Rendering-Engine 适用于需要高效实时渲染引擎的各类项目,例如实时模拟、虚拟现实、游戏开发等。在引入该引擎时,需要注意以下几点:

  1. 硬件要求:使用 DX12 SDK 的开发者需要确保硬件支持和驱动更新。
  2. 持续更新:由于 DirectX 版本的快速迭代,开发者需要关注其更新及其对引擎的影响。
  3. 性能优化:尽管架构设计精良,但在复杂的渲染场景下依然要有针对性地进行性能优化。

综合评价

优点

  • 对照市场中现有的渲染引擎,EveryRay-Rendering-Engine 拥有更强的性能和更广泛的兼容性。
  • 使用 DX12 提供的低级接口管理具有更低的性能消耗,使渲染性能更有保障。
  • 高级光线追踪功能提供真实感更强的视觉效果。

缺点

  • 高级功能的引入,对终端用户的硬件有较高的要求。
  • 由于 DX12 相对新的特性,可能面临一些兼容性和优化上的不足。

通过这篇分析,我们深入剖析了 EveryRay-Rendering-Engine 的技术细节,以及其在当前实时渲染引擎领域的地位与潜力。对于寻求高质量图形渲染的开发者来说,本项目无疑是值得深入了解的宝贵资源。

关于

GitHub 原始描述(英文)

Robust real-time rendering engine on DX11, DX12 with many advanced graphical features for quick prototyping

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

语言占比

C
C++
HLSL

Release

README

EveryRay-Rendering-Engine

Ver 1.1.2 (Change Log)

Introduction

“EveryRay” is a rendering engine that is written in C++ with a focus on quick prototyping of graphical techniques and features. It is lightweight, easy to use and already contains many existing rendering solutions inside.

“EveryRay” is not a game engine. It was never made with that in mind which resulted in building the engine with a minimal amount of components/systems outside the graphics part. It is not impossible to make a proper game engine out of “EveryRay”, however, there are many other projects that were architectured specifically for that instead.

“EveryRay” is not a library that can be disconnected and connected to your project either. It is not modular and was never meant to be. However, there is at least a distinction between low-level graphics code and high-level systems in the engine which you can borrow for your own needs.

Lastly, “EveryRay” was made by a graphics programmer for those who are interested in real-time rendering and who do not want to spend time setting up a bunch of engine-related things that are needed when you begin writing your personal engine of any kind. You can think of “EveryRay” as a “toy engine/tech demo on steroids” or, in other words, a simple sandbox with minimal UI for testing complex ideas with the help of various prepared functionalities.

You can read more about the architecture of “EveryRay” in the documentation:

You can see a video demonstration of “EveryRay” here (scroll down for screenshots):

Rendering features

  • Deferred + Forward Rendering
  • Local illumination w/ Physically Based Rendering
  • Global illumination w/:
    • Static: Image Based Lighting from light probes:
      • diffuse (2nd order spherical harmonics)
      • specular (cubemaps)
    • Dynamic: Cascaded Voxel Cone Tracing (AO, diffuse, specular)
  • Cascaded Shadow Mapping
  • Parallax-Occlusion Mapping w/ soft self-shadowing
  • Terrain w/ GPU tessellation
  • Foliage zones
  • Volumetric clouds
  • Volumetric fog
  • Post Processing Volumes with Linear Fog, Screen Space Reflections, Separable Subsurface Scattering, Tonemapping, LUT color grading, Vignette, Anti-aliasing (FXAA)
  • Special materials: Snow, Fresnel-Outline, Fake-Transparency (reflect+refract), Fur Shell

You can read more in Graphics Overview

Engine features

  • Concept of an “ER_RHI” (aka “Rendering Hardware Interface”): graphics API is abstracted from the general code (systems, etc.)
    • supports DX11, DX12
  • Concept of a simplified generic game object - “ER_RenderingObject”:
    • supports model loading (.obj, .fbx and etc.) with Assimp Library
    • supports multiple meshes
    • supports texture loading (.png, .jpg, .dds)
    • supports materials
    • supports GPU instancing
    • supports LOD groups
    • supports indirect GPU rendering (GBuffer, Shadow, Forward passes) w/ GPU culling
    • supports AABB (with visualization)
    • supports on-terrain procedural placement & instances distribution
    • customizable via “Object editor” (with instancing support)
  • Concept of a generic scene, which contains “ER_RenderingObject” elements + scene data (lights, terrain, GI and other info):
    • supports loading from & saving to JSON scene files
  • Concept of graphics presets for achieving performance on various hardware configurations
    • impacts the quality of several systems (resolutions, shadows, textures, etc.)
  • CPU frustum culling
  • ImGUI, ImGuizmo
  • Input from mouse, keyboard and gamepad (XInput, but you can add your own)

You can read more in Engine Overview

Controls

  • “Mouse + Right Click” or “Right Thumbstick” - camera rotation
  • “W/A/S/D” or “Left Thumbstick” - camera side movement (on gamepad holding “Left Trigger”/“Right Trigger” will slow/fasten the movement)
  • “E/Q” - camera up/down movement
  • “Backspace” or “Back Gamepad Button” - enable/disable editor
  • “R/T/Y” - scale/translate/rotate object in the editor mode

Gamepad is currently not supported/tested with ImGui.

Screenshots

picture picture picture picture picture picture

Scenes

Over the years many scenes have been created for “EveryRay”. However, to make things simpler, only a few are included in the public version of this repository:

Name Description Screenshot
testScene_simple Default startup scene with a few basic objects
testScene Advanced scene with various materials, post-effects volumes, foliage, lights, and light probes
terrainScene Foliage and several types of GPU indirect objects scattered on top of terrain

Learn more about levels in Engine Overview

Roadmap

Big features that require a branch/merge request and a considerable amount of time.

Engine

Graphics

  • Order Independent Transparency (in Forward pass)
  • Atmospheric Scattering (Mie, etc.)
  • Contact hardening shadows
  • Stochastic reflections
  • Better Anti-Aliasing (SMAA, TAA, explore FSR/DLSS)
  • Hardware accelerated ray-tracing (i.e., DXR shadows, reflections, AO)
  • High-poly geometry with mesh shaders

External Dependencies

References

  • “Real-Time 3D Rendering with DirectX and HLSL: A Practical Guide to Graphics Programming” by Paul Varcholik
  • “Real-Time Rendering” 3rd/4th ed. by Tomas Möller, Naty Hoffman, Eric Haines
  • “GPU Gems” series
  • “GPU Pro” series
  • numerous SIGGRAPH, GDC papers, and blog posts by fellow graphics geeks and vendors :)

Requirements

评论

暂无评论