Files
nexus/wiki/concepts/HDRP.md
2026-05-03 05:42:12 +08:00

68 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "HDRP (High Definition Render Pipeline)"
type: concept
tags: [game-dev, rendering, unity, pipeline]
sources: [unity-shader-graph-artist]
last_updated: 2026-05-01
---
## Aliases
- High Definition Render Pipeline
- HDRP
- HD Render Pipeline
## Definition
HDRPHigh Definition Render Pipeline高清渲染管线是 Unity 的高端渲染管线,专为 PC 和 ConsolePlayStation、Xbox的高视觉质量项目设计。HDRP 提供物理光照模型、光线追踪支持、体积雾、屏幕空间环境遮蔽等 AAA 级渲染特性。相比 URPHDRP 的渲染质量更高,但不支持移动端,且自定义通道 API 与 URP 不兼容。
## Core Architecture
### CustomPass 系统
HDRP 自定义通道的核心扩展点:
```csharp
// HDRP 必须使用 CustomPassVolume + CustomPass
// 与 URP 的 ScriptableRendererFeature API 不兼容
public class MyCustomPass : CustomPass
{
protected override void Execute(ScriptableRenderContext context, CommandBuffer cmd, PassData passData,
ref RenderingData renderingData)
{ /* HDRP 自定义渲染逻辑 */ }
}
```
### 关键约束
- **禁止使用** `OnRenderImage`Built-in only
- **禁止使用** URP 的 `ScriptableRendererFeature`API 不兼容)
- HDRP 不支持移动端部署
- Shader Graph 必须设置正确的 HDRP Render Pipeline Asset
- HDRP 图形无法直接在 URP 中工作,需要反向 Porting
### 与 URP 的核心区别
| 特性 | HDRP | URP |
|------|------|-----|
| 目标平台 | PC/Console高端 | PC/Console/Mobile/VR |
| 渲染质量 | 极高(光线追踪/物理光照) | 中等-高 |
| 自定义通道 API | `CustomPassVolume` | `ScriptableRendererFeature` |
| API 兼容性 | **不兼容** URP | **不兼容** HDRP |
| 移动端支持 | ❌ 不支持 | ✅ 支持 |
## Shader Graph in HDRP
- Shader Graph 支持 HDRP 的物理光照模型Lit Shader
- Substrate 多层材质UE5.3+ 替代 SSS workaround
- 必须使用 Sub-Graph 封装可复用逻辑
- HDRP 的 Shader Graph 资产需要显式 Porting 才能在 URP 项目中使用
## Performance
HDRP 主要面向 PC/Console 平台,移动端不是其目标场景。但仍建议在 Frame Debugger 中审计每个 Shader 的实际 GPU 开销。
## Connections
- [[Shader]] ← 渲染目标 ← HDRP
- [[UnityShaderGraphArtist]] ← 专精 ← HDRP
- [[URP]] ← 互补管线 ← HDRP不兼容
- [[CustomPass]] ← 核心 API ← HDRP
- [[CustomPassVolume]] ← 扩展机制 ← HDRP