Files
BlueRoseNote/03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/REDSceneContext.md

1.8 KiB
Raw Blame History

title, date, excerpt, tags, rating
title date excerpt tags rating
REDSceneContext 2026-05-03 00:00:00 全局 Shader 数据管线,提供 BGMultColor、灾害效果等 Shader 可访问数据
ARC
Gameplay
Rendering

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, ...)

灾害效果系统

DisasterPositionDisasterWindDisasterQuake 三个参数用于格斗游戏中的必杀技演出——场景因攻击而震动、风吹、变形等效果,由 Shader 读取这些参数来驱动场景顶点动画和粒子。

关联文档

修改文件列表

文件 修改类型
Source/Runtime/Engine/Public/REDSceneContext.h 新增
Source/Runtime/Renderer/Private/SceneRendering.cpp 读取 Context 写入 ViewUniform