Files
BlueRoseNote/03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/RED场景视图类型.md

63 lines
1.7 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: RED场景视图类型
date: 2026-05-03 00:00:00
excerpt: 角色/特效/背景/HUD 分层渲染系统
tags:
- ARC
- Gameplay
- Rendering
rating: ⭐
---
# RED 场景视图类型
返回 [[Gameplay]]
## 概述
新增 `EREDSceneViewType` 枚举,将场景中的 Actor 按类型分层允许选择性渲染特定层级。格斗游戏中常用于角色和背景使用不同的后处理参数、特效层独立控制、HUD 层分离等。
## 视图类型
```cpp
enum class EREDSceneViewType
{
REDSceneView_Character, // 角色层
REDSceneView_Effect, // 特效层
REDSceneView_BG, // 背景层(主)
REDSceneView_BG_Layer1, // 背景分层 1
REDSceneView_BG_Layer2, // 背景分层 2
// ... Layer3 ~ Layer8
REDSceneView_HUD // HUD 层
};
```
## 使用方式
### Actor 端
每个 Actor 拥有 `REDSceneViewType` 属性,在编辑器中设置所属层级。
### 渲染端
`PlayerController::GetREDSceneViewTypeFlag()` 返回当前需要渲染的层级位掩码Scene Visibility 阶段根据此掩码过滤 Actor。
### 排序键
自定义排序键影响渲染顺序,确保分层正确。
## 使用场景
- 角色层独立使用 [[BGMultColor全局色调]] 而不影响背景
- 背景多层分离实现视差效果
- 特效层独立的 Bloom 和后处理参数
- 对战 UI血条等使用 HUD 层,不受场景后处理影响
## 修改文件列表
| 文件 | 修改类型 |
|------|---------|
| `Source/Runtime/Engine/Public/EngineTypes.h` | `EREDSceneViewType` 枚举 |
| `Source/Runtime/Engine/Classes/GameFramework/PlayerController.h` | `GetREDSceneViewTypeFlag()` |
| `Source/Runtime/Renderer/Private/SceneVisibility.cpp` | 可见性过滤 |