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 的渲染架构围绕三种文件类型组织,分离了不同关注点:

Material Pipeline | +-- .surf (XML) // Material Properties Declaration | +-- LightingModel (Isotropy/Skin/Hair/ClearCoat/Toon...) | +-- Code File --> points to .hlsl | +-- Macro Switches (LIGHT_ENABLE, NORMAL_MAP_ENABLE...) | +-- Resources (Tex0-Tex7 slots, Parameters) | +-- .nfx // Technique/Pass/Shader Entry Points | +-- Technique (TShader) | +-- Pass (p0, p1...) | +-- VertexShader --> .vs es300 vs_main | +-- PixelShader --> .ps es300 ps_main | +-- .hlsl // Shader Implementation (HLSL Dialect) +-- Material Functions (CalcMaterialParam) +-- Property Getters (GetAlbedo/Normal/Roughness/Metalness) +-- Lighting Code (forward_shading.hlsl)

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:

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 — 关键差异

Design Philosophy: NeoX prioritizes complete shader-level control and minimal abstraction layers. Every rendering feature is a direct HLSL implementation. UE5 prioritizes high-level tooling (Material Editor, Niagara, Blueprint) and next-gen rendering systems (Nanite/Lumen/VSM) at the cost of more abstraction layers. 设计哲学:NeoX 优先考虑完整的 Shader 级控制最少的抽象层。每个渲染功能都是直接的 HLSL 实现。UE5 优先考虑高层工具(材质编辑器、Niagara、蓝图)和次世代渲染系统(Nanite/Lumen/VSM),代价是更多抽象层。

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 项目中的实际文件路径。

Suggested reading order: Start with the Shader System articles (01-A, 01-B) to understand NFX/SURF/HLSL file formats. Then read the Rendering Pipeline articles (02-A, 02-B) for the big picture. Material System (03) and Lighting Models (04) build on the shader system foundation. Post Processing (05) can be read independently. 建议阅读顺序:从 Shader 系统文章(01-A、01-B)开始了解 NFX/SURF/HLSL 文件格式。然后阅读渲染管线文章(02-A、02-B)获得全局视图。材质系统(03)和光照模型(04)建立在 Shader 系统基础上。后处理(05)可以独立阅读。

Series Map系列地图

05 Post Processing05 后处理

06 Custom Features *(planned)*06 自定义功能 *(待写)*

  • Planet Rendering System星球渲染系统
  • PSE Particle SystemPSE 粒子系统