Particle System Editor를 구현한다.
Sprite Emitter, Mesh Emitter를 지원한다.
아래 6번 커브 에디터는 선택 사항입니다.

Particle System Component (PSC)를 월드에 배치, 렌더링한다.
Show Flag, Stat을 구현한다.
class UParticleModule : public UObject
{
};
/*
UParticleModuleRequired: Emitter에 필수적인 설정을 포함하며, 파티클의 기본 속성들을 정의합니다.
UParticleModuleSpawn: 파티클의 생성 빈도와 수량을 제어합니다.
UParticleModuleLifetime: 파티클의 수명을 설정합니다.
UParticleModuleLocation: 파티클의 초기 위치를 결정합니다.
UParticleModuleVelocity: 파티클의 초기 속도와 방향을 설정합니다.
UParticleModuleColor: 파티클의 색상을 정의하며, 시간에 따른 색상 변화를 설정할 수 있습니다.
UParticleModuleSize: 파티클의 크기를 설정합니다.
*/
class UParticleLODLevel : public UObject
{
int32 Level;
bool bEnabled;
UParticleModuleRequired* RequiredModule;
TArray<UParticleModule*> Modules;
UParticleModuleTypeDataBase* TypeDataModule;
};
class UParticleEmitter : public UObject
{
TArray<UParticleLODLevel*> LODLevels;
void CacheEmitterModuleInfo()
{
ParticleSize = sizeof(FBaseParticle);
...
}
};
class UParticleSystem : public UObject
{
TArray<UParticleEmitter*> Emitters;
...
};
struct FBaseParticle
{
FVector Location;
FVector Velocity;
float RelativeTime;
float Lifetime;
FVector BaseVelocity;
float Rotation;
float RotationRate;
FVector Size;
FColor Color;
...
};
struct FParticleDataContainer
{
int32 MemBlockSize;
int32 ParticleDataNumBytes;
int32 ParticleIndicesNumShorts;
uint8* ParticleData; // this is also the memory block we allocated
uint16* ParticleIndices; // not allocated, this is at the end of the memory block
...
};
struct FDynamicEmitterReplayDataBase
{
/** The type of emitter. */
EDynamicEmitterType eEmitterType;
/** The number of particles currently active in this emitter. */
int32 ActiveParticleCount;
int32 ParticleStride;
FParticleDataContainer DataContainer;
FVector3f Scale;
int32 SortMode;
...
};
struct FDynamicSpriteEmitterReplayDataBase : public FDynamicEmitterReplayDataBase
{
UMaterialInterface* MaterialInterface;
struct FParticleRequiredModule *RequiredModule;
...
};
struct FDynamicEmitterDataBase
{
int32 EmitterIndex;
...
virtual const FDynamicEmitterReplayDataBase& GetSource() const = 0;
...
};
struct FDynamicSpriteEmitterDataBase : public FDynamicEmitterDataBase
{
void SortSpriteParticles(...);
virtual int32 GetDynamicVertexStride(ERHIFeatureLevel::Type /*InFeatureLevel*/) const = 0;
...
};
struct FDynamicSpriteEmitterData : public FDynamicSpriteEmitterDataBase
{
virtual int32 GetDynamicVertexStride(ERHIFeatureLevel::Type InFeatureLevel) const override
{
return sizeof(FParticleSpriteVertex);
}
...
};
struct FDynamicMeshEmitterData : public FDynamicSpriteEmitterData
{
virtual int32 GetDynamicVertexStride(ERHIFeatureLevel::Type /*InFeatureLevel*/) const override
{
return sizeof(FMeshParticleInstanceVertex);
}
...
};
struct FParticleEmitterInstance
{
UParticleEmitter* SpriteTemplate;
// Owner
UParticleSystemComponent* Component;
int32 CurrentLODLevelIndex;
UParticleLODLevel* CurrentLODLevel;
/** Pointer to the particle data array. */
uint8* ParticleData;
/** Pointer to the particle index array. */
uint16* ParticleIndices;
/** Pointer to the instance data array. */
uint8* InstanceData;
/** The size of the Instance data array. */
int32 InstancePayloadSize;
/** The offset to the particle data. */
int32 PayloadOffset;
/** The total size of a particle (in bytes). */
int32 ParticleSize;
/** The stride between particles in the ParticleData array. */
int32 ParticleStride;
/** The number of particles currently active in the emitter. */
int32 ActiveParticles;
/** Monotonically increasing counter. */
uint32 ParticleCounter;
/** The maximum number of active particles that can be held in
* the particle data array.
*/
int32 MaxActiveParticles;
/** The fraction of time left over from spawning. */
void SpawnParticles( int32 Count, float StartTime, float Increment, const FVector& InitialLocation, const FVector& InitialVelocity, struct FParticleEventInstancePayload* EventPayload )
{
for (int32 i = 0; i < Count; i++)
{
DECLARE_PARTICLE_PTR
PreSpawn(Particle, InitialLocation, InitialVelocity);
for (int32 ModuleIndex = 0; ModuleIndex < LODLevel->SpawnModules.Num(); ModuleIndex++)
{
...
}
PostSpawn(Particle, Interp, SpawnTime);
}
}
void KillParticle(int32 Index);
...
};
class UParticleSystemComponent
{
TArray<struct FParticleEmitterInstance*> EmitterInstances;
UParticleSystem* Template;
TArray<FDynamicEmitterDataBase*> EmitterRenderData;
...
};
// ParticleHelper.h
DECLARE_PARTICLE_PTR
BEGIN_UPDATE_LOOP
END_UPDATE_LOOP
void UParticleModuleSizeScaleBySpeed::Update(FParticleEmitterInstance* Owner, int32 Offset, float DeltaTime)
{
FVector Scale(SpeedScale.X, SpeedScale.Y, 1.0f);
FVector ScaleMax(MaxScale.X, MaxScale.Y, 1.0f);
BEGIN_UPDATE_LOOP;
FVector Size = Scale * Particle.Velocity.Size();
Size = Size.ComponentMax(FVector(1.0f));
Size = Size.ComponentMin(ScaleMax);
Particle.Size = GetParticleBaseSize(Particle) * (FVector3f)Size;
END_UPDATE_LOOP;
}
Symbol Server를 구축한다.
srctool.exe, pdbstr.exe, symstore.exe
\192.168.xxx.yyy\symbols (Window Share Folder)