vault backup: 2026-05-03 20:37:58
This commit is contained in:
33
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/Gameplay.md
Normal file
33
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/Gameplay.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: Gameplay
|
||||
date: 2026-05-03 00:00:00
|
||||
excerpt: ARC 引擎游戏性系统修改分类索引
|
||||
tags:
|
||||
- ARC
|
||||
- Gameplay
|
||||
rating: ⭐
|
||||
---
|
||||
|
||||
# Gameplay — 游戏性系统
|
||||
|
||||
返回 [[ARC引擎修改总览]]
|
||||
|
||||
## 概述
|
||||
|
||||
ARC 引擎为格斗游戏新增了场景视图分层、全局 Shader 数据管线、相机控制扩展和引擎回调接口等游戏性支撑系统。
|
||||
|
||||
## 功能列表
|
||||
|
||||
| 功能 | 文档 | 说明 |
|
||||
|------|------|------|
|
||||
| RED 场景视图类型 | [[RED场景视图类型]] | 角色/特效/背景/HUD 分层渲染 |
|
||||
| REDSceneContext | [[REDSceneContext]] | 全局 Shader 数据管线 |
|
||||
| 相机系统扩展 | [[相机系统扩展]] | 水平翻转、自动释放 |
|
||||
| UEI 事件系统 | [[UEI事件系统]] | 引擎回调接口 |
|
||||
|
||||
## 其他小修改
|
||||
|
||||
- **方向光**:`bIgnoreResetBuildLighting` — 旋转方向光时不重置 Lightmap
|
||||
- **纹理 LOD**:`AdditionalLODBias` — 逐场景 LOD 偏移用于内存管理
|
||||
- **存档路径**:`/RED/` → `/GGST/` 路径重映射,Beta 构建独立存档
|
||||
- **构建标记**:`BUILD_ASW_BETA` 定义
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: REDSceneContext
|
||||
date: 2026-05-03 00:00:00
|
||||
excerpt: 全局 Shader 数据管线,提供 BGMultColor、灾害效果等 Shader 可访问数据
|
||||
tags:
|
||||
- ARC
|
||||
- Gameplay
|
||||
- Rendering
|
||||
rating: ⭐
|
||||
---
|
||||
|
||||
# REDSceneContext
|
||||
|
||||
返回 [[Gameplay]]
|
||||
|
||||
## 概述
|
||||
|
||||
`UREDSceneContext` 是 ARC 引擎的全局 Shader 数据管线,将游戏逻辑层的数据传递给 Shader 使用。它是一个 UObject,可以在蓝图和 C++ 中设置参数,数据通过 `ViewUniformShaderParameters` 传入 GPU。
|
||||
|
||||
## 提供的数据
|
||||
|
||||
| 参数 | 类型 | 用途 |
|
||||
|------|------|------|
|
||||
| `BGMultColor` | FLinearColor | [[BGMultColor全局色调]]:场景颜色乘算 + 饱和度 |
|
||||
| `DisasterPosition` | FVector | 灾害效果中心位置(场景破坏特效) |
|
||||
| `DisasterWind` | FVector | 灾害风力方向和强度 |
|
||||
| `DisasterQuake` | float | 灾害震动强度 |
|
||||
| `GameTime` | float | 游戏时间(用于 Shader 动画) |
|
||||
| `BGTime` | float | 背景时间(可独立于 GameTime) |
|
||||
|
||||
## 数据流
|
||||
|
||||
```
|
||||
游戏逻辑 (Blueprint/C++)
|
||||
↓ 设置 UREDSceneContext 参数
|
||||
REDSceneContext
|
||||
↓ SceneRendering.cpp 读取
|
||||
ViewUniformShaderParameters
|
||||
↓ Upload to GPU
|
||||
Shader (View.BGMultColor, View.DisasterPosition, ...)
|
||||
```
|
||||
|
||||
## 灾害效果系统
|
||||
|
||||
`DisasterPosition`、`DisasterWind`、`DisasterQuake` 三个参数用于格斗游戏中的必杀技演出——场景因攻击而震动、风吹、变形等效果,由 Shader 读取这些参数来驱动场景顶点动画和粒子。
|
||||
|
||||
## 关联文档
|
||||
|
||||
- [[BGMultColor全局色调]] — 使用 `BGMultColor` 参数
|
||||
- [[RED场景视图类型]] — 场景分层与 Context 配合
|
||||
|
||||
## 修改文件列表
|
||||
|
||||
| 文件 | 修改类型 |
|
||||
|------|---------|
|
||||
| `Source/Runtime/Engine/Public/REDSceneContext.h` | **新增** |
|
||||
| `Source/Runtime/Renderer/Private/SceneRendering.cpp` | 读取 Context 写入 ViewUniform |
|
||||
62
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/RED场景视图类型.md
Normal file
62
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/RED场景视图类型.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
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` | 可见性过滤 |
|
||||
64
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/UEI事件系统.md
Normal file
64
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/UEI事件系统.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
title: UEI事件系统
|
||||
date: 2026-05-03 00:00:00
|
||||
excerpt: 引擎回调接口,提供帧生命周期和输入处理钩子
|
||||
tags:
|
||||
- ARC
|
||||
- Gameplay
|
||||
- Framework
|
||||
rating: ⭐
|
||||
---
|
||||
|
||||
# UEI 事件系统
|
||||
|
||||
返回 [[Gameplay]]
|
||||
|
||||
## 概述
|
||||
|
||||
UEI(Unreal Engine Interface)事件系统提供了游戏逻辑与引擎生命周期之间的回调接口。它在引擎的关键时间点触发回调,让游戏层能精确控制帧内的执行时序。
|
||||
|
||||
## FUEIEventHandler
|
||||
|
||||
```cpp
|
||||
// UEIEventHandler.h
|
||||
class FUEIEventHandler
|
||||
{
|
||||
// 帧生命周期回调
|
||||
void BeginFrame();
|
||||
void EndFrame();
|
||||
void Update();
|
||||
|
||||
// 输入处理钩子
|
||||
// 格斗游戏需要在精确的时间点采样输入
|
||||
};
|
||||
```
|
||||
|
||||
## FUEISlateApplication
|
||||
|
||||
继承 `FSlateApplication`,扩展输入管理:
|
||||
|
||||
```cpp
|
||||
class FUEISlateApplication : public FSlateApplication
|
||||
{
|
||||
// User/Controller ID 映射
|
||||
TMap<int32, int32> UserIndexMap;
|
||||
|
||||
// 格斗游戏多手柄输入分配
|
||||
};
|
||||
```
|
||||
|
||||
格斗游戏中两个玩家可能使用不同的控制器,`UserIndexMap` 负责将物理控制器 ID 映射到游戏内的玩家 ID。
|
||||
|
||||
## 使用场景
|
||||
|
||||
- 格斗游戏帧同步:在精确的帧时间点采样输入
|
||||
- 回放系统:按帧记录和回放输入
|
||||
- 控制器热插拔处理
|
||||
|
||||
## 修改文件列表
|
||||
|
||||
| 文件 | 修改类型 |
|
||||
|------|---------|
|
||||
| `Source/Runtime/Engine/Public/UEIEventHandler.h` | **新增** |
|
||||
| `Source/Runtime/Slate/Public/Framework/Application/UEISlateApplication.h` | **新增** |
|
||||
| `Source/Runtime/Slate/Private/Framework/Application/UEISlateApplication.cpp` | **新增** |
|
||||
40
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/相机系统扩展.md
Normal file
40
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/相机系统扩展.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: 相机系统扩展
|
||||
date: 2026-05-03 00:00:00
|
||||
excerpt: 相机动画水平翻转和自动释放机制
|
||||
tags:
|
||||
- ARC
|
||||
- Gameplay
|
||||
- Camera
|
||||
rating: ⭐
|
||||
---
|
||||
|
||||
# 相机系统扩展
|
||||
|
||||
返回 [[Gameplay]]
|
||||
|
||||
## 概述
|
||||
|
||||
为格斗游戏的相机需求扩展了 `CameraAnimInst`。
|
||||
|
||||
## 水平翻转(bPlayCameraAnimFlipH)
|
||||
|
||||
```cpp
|
||||
bool bPlayCameraAnimFlipH;
|
||||
```
|
||||
|
||||
在格斗游戏中,当玩家 1 和玩家 2 交换左右位置时(交叉),相机动画需要水平翻转以保持视觉一致性。此标记控制相机震动、特写等动画的水平翻转。
|
||||
|
||||
## 自动释放(bAutoReleaseWhenFinished)
|
||||
|
||||
```cpp
|
||||
bool bAutoReleaseWhenFinished;
|
||||
```
|
||||
|
||||
相机动画播放完毕后自动释放实例,避免格斗游戏频繁的相机震动(受击、必杀技等)导致的实例泄漏。
|
||||
|
||||
## 修改文件列表
|
||||
|
||||
| 文件 | 修改类型 |
|
||||
|------|---------|
|
||||
| `Source/Runtime/Engine/Classes/Camera/CameraAnimInst.h` | 新增标记 |
|
||||
Reference in New Issue
Block a user