Introduction 简介
What is NeoX Engine?什么是 NeoX 引擎?
NeoX is NetEase's proprietary real-time rendering engine, powering titles like "Infinite Lagrange" (无尽的拉格朗日). Unlike commercial engines, NeoX provides complete shader-level control — every rendering technique is implemented through handwritten HLSL shaders, NFX effect files, and SURF material descriptors. This gives artists unprecedented technical freedom but requires deep understanding of the rendering pipeline to use effectively.
NeoX 是网易自研的实时渲染引擎,支持《无尽的拉格朗日》等游戏项目。与商业引擎不同,NeoX 提供完整的 Shader 级控制—— 所有渲染技术都通过手写 HLSL 着色器、NFX 效果文件和 SURF 材质描述符实现。这为美术师提供了前所未有的技术自由度, 但需要对渲染管线有深入理解才能有效使用。
Core Architecture核心架构
NeoX's rendering architecture is organized around three file types that separate concerns:
NeoX 的渲染架构围绕三种文件类型组织,分离了不同关注点:
This three-tier system decouples material authoring (.surf editing), rendering technique (.nfx), and shader code (.hlsl). Artists primarily work with .surf files, while engineers write .hlsl implementations.
这个三层系统将材质创作(.surf 编辑)、渲染技法(.nfx)和着色器代码(.hlsl)解耦。 美术师主要使用 .surf 文件,而工程师编写 .hlsl 实现。
Shader System Design PhilosophyShader 系统设计哲学
NeoX's shader system is built on several key principles that differentiate it from UE5:
NeoX 的 Shader 系统基于几个关键原则,这些原则使其区别于 UE5:
- No Visual Shader Editor: All materials are written as HLSL code or configured via XML. No node-based Material Editor like UE's Blueprint system.
- 无可视化 Shader 编辑器:所有材质都通过 HLSL 代码编写或 XML 配置。没有像 UE 蓝图系统那样的节点编辑器。
- Cross-Platform by Design: Shaders are written in a custom HLSL dialect that compiles to both D3D11 and OpenGL ES/Metal. Pre-compiled
.ps/.vsfiles for GL/Metal platforms are checked into the repository. - 跨平台设计:着色器使用自定义 HLSL 方言编写,可编译到 D3D11 和 OpenGL ES/Metal。预编译的
.ps/.vs文件(GL/Metal 平台)直接提交到代码库。 - Declarative Pipeline Configuration: The entire rendering pipeline is configured via
forward_shading.renderXML file, which declares VertexFragmentModels, LightingModels, BlendStates, DepthStates, and ShaderCompositors in one place. - 声明式管线配置:整个渲染管线通过
forward_shading.renderXML 文件配置,在一处声明 VertexFragmentModels、LightingModels、BlendStates、DepthStates 和 ShaderCompositors。 - Macro-Based Shader Variants: Instead of UE's ShaderPermutationDomain, NeoX uses
macro_define.xmlto enumerate all valid macro combinations (INSTANCE_TYPE, TON_MAPPING_TYPE, LOD_LEVEL_TYPE, etc.). - 基于宏的 Shader 变体:NeoX 使用
macro_define.xml枚举所有有效宏组合(INSTANCE_TYPE、TON_MAPPING_TYPE、LOD_LEVEL_TYPE 等),而不是 UE 的 ShaderPermutationDomain。
Rendering Technologies渲染技术
NeoX implements a comprehensive set of rendering technologies, with some unique systems not found in UE5:
NeoX 实现了一套全面的渲染技术,其中一些独特系统在 UE5 中找不到:
| Technology技术 | NeoX ImplementationNeoX 实现 | UE5.6 EquivalentUE5.6 对应物 |
|---|---|---|
| BRDF | GGX (D_GGX + F_Schlick + SmithJoint)GGX(D_GGX + F_Schlick + SmithJoint) | Similar (GGX with slight variations)类似(GGX 略有差异) |
| Shading Models光照模型 | 13 models (Isotropy/Skin/Hair/ClearCoat/Toon/SSSS/etc.)13 种模型(Isotropy/Skin/Hair/ClearCoat/Toon/SSSS等) | 11 models (no built-in Toon)11 种模型(无内置 Toon) |
| Multi-Layered PBR多层 PBR | Built-in N-layer clearcoat system内置 N 层清漆系统 | Substrate (experimental, UE5.4+)Substrate(实验性,UE5.4+) |
| Planet Rendering星球渲染 | ✓ Complete planet shader system (672-line library)✓ 完整星球着色器系统(672 行库) | ✗ No built-in system✗ 无内置系统 |
| Post Processing后处理 | ~60+ hand-written effects~60+ 手写效果 | ~30+ built-in + PostProcessVolume~30+ 内置 + PostProcessVolume |
| Dynamic GI动态 GI | Light Probe SH (limited)Light Probe SH(有限) | Lumen (full dynamic GI)Lumen(全动态 GI) |
| Nanite | ✗ No equivalent✗ 无对应物 | ✓ Virtual geometry system✓ 虚拟几何系统 |
| Shadow Maps阴影贴图 | CSM | CSM + Virtual Shadow MapsCSM + 虚拟阴影贴图 |
NeoX vs UE5.6 — Key DifferencesNeoX vs UE5.6 — 关键差异
When NeoX excels: Projects requiring deep customization of rendering algorithms, mobile optimization with tight memory budgets, or specific visual styles (e.g., stylized toon shading, procedural space effects) benefit from NeoX's direct shader control.
NeoX 擅长的场景:需要深度定制渲染算法、移动端优化(严格内存预算)、或特定视觉风格(如风格化卡通着色、程序化太空效果)的项目 受益于 NeoX 的直接 Shader 控制。
When UE5 excels: Projects requiring film-quality visuals in real time, large open worlds, or rapid prototyping benefit from UE5's Nanite/Lumen/VSM and high-level authoring tools.
UE5 擅长的场景:需要实时电影级画质、大型开放世界、或快速原型开发的项目 受益于 UE5 的 Nanite/Lumen/VSM 和高层创作工具。
How to Read This Series如何阅读本系列
This series is structured to mirror the actual shader codebase organization at res/shader/.
Each article examines a specific subsystem with references to actual file paths in the G86 project.
本系列按照 res/shader/ 中实际 Shader 代码库的组织结构编写。
每篇文章检查特定子系统,并引用 G86 项目中的实际文件路径。
Series Map系列地图
01 Shader System01 Shader 系统
02 Rendering Pipeline02 渲染管线
03 Material System03 材质系统
04 Lighting Models04 光照模型
05 Post Processing05 后处理
06 Custom Features *(planned)*06 自定义功能 *(待写)*
- Planet Rendering System星球渲染系统
- PSE Particle SystemPSE 粒子系统