Files
BlueRoseNote/03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Particle/粒子点光源系统.md

69 lines
2.0 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: 粒子点光源系统
date: 2026-05-03 00:00:00
excerpt: IREDPointLightInterface 粒子驱动点光源和静态网格切换模块
tags:
- ARC
- Particle
- Lighting
rating: ⭐
---
# 粒子点光源系统
返回 [[Particle]]
## 概述
新增 `IREDPointLightInterface` 接口,允许粒子系统动态创建和管理点光源。格斗游戏中的特效(火焰、电击、能量弹等)需要动态光照来增强视觉表现。
## IREDPointLightInterface
```cpp
// REDParticlePointLightUtilities.h
class IREDPointLightInterface
{
// 点光源参数
FVector Location; // 位置
FLinearColor LightColor; // 光照颜色
FLinearColor AmbientColor; // 环境光颜色
float Amplitude; // 强度振幅(闪烁)
float Frequency; // 闪烁频率
float Attenuation; // 衰减
float Range; // 范围
float Cutoff; // 截止距离
float DistanceMultiply; // 距离乘数
};
```
## 特性
- 粒子生命周期绑定——粒子消亡时自动移除对应点光源
- 支持振幅和频率控制的闪烁效果
- 衰减和截止距离独立控制
## 静态网格切换模块
新增 `UParticleModuleStaticMeshSwitch`
```cpp
// 根据 SubImage Index 切换粒子使用的静态网格 Section
// 类似 SubUV 的概念但用于 3D 网格的不同部分
```
用于格斗游戏特效中:同一个粒子发射器根据阶段显示不同形状的网格(如能量球从小到大变形)。
## 关联文档
- [[RED阴影系统]] — 点光源的阴影着色
- [[RED自定义数据通道]] — 点光源模式下 CustomData 的使用
## 修改文件列表
| 文件 | 修改类型 |
|------|---------|
| `Source/Runtime/Engine/Public/REDParticlePointLightUtilities.h` | **新增** |
| `Source/Runtime/Engine/Private/Particles/REDParticlePointLightUtilities.cpp` | **新增** |
| `Source/Runtime/Engine/Private/Particles/ParticleModuleStaticMeshSwitch.cpp` | **新增** |
| `Shaders/Private/MeshParticleVertexFactory.ush` | Bug 修复 |