UE5 Guid Page : https://docs.unrealengine.com/4.27/ko/RenderingAndGraphics/Niagara/Overview/
기본 구성
- 나이아가라 시스템
[1] Attribute(Parameter) → [5] Detail(argument) 직접 대응 가능 ( 드래그 ) 나 - 나이아가라 그룹 모듈
기본 구조
Niagara System
- Overview Node ( system manager )
- Emitter ( include [Items] )
- Properties
- Render
- Stages ( Emt Sapwn / Emt update / Ptc Spawn / Ptc Update )
- Module
- Parameter
- Owner : Engine / System / Emitter / Particles / Stage transient / module output
- Type
- Primitive : 일반 변수타입
- Enum
- Struct
- Data Interface : 외부 데이터소스 ( api, datatable등 )
- Parameter
- Additional Stage
- Events ( → Event Handler )
- Simulation Stage
- Module
Niagara Module Flow

- GetMap(get Params value) → Adjust Action → SetMap(set Params value)
- module node based on bool / basic math / trigonometric / etc
Event and Event Handler
- Concept : interaction between [Niagara Emitters] ( UE _ 이벤트 및 이벤트 핸들러 개요 )
- Note
- 이벤트는 현재 GPU 시뮬레이션과는 함께 작동하지 않고 CPU 시뮬레이션과만 함께 작동합니다.
- 이벤트를 사용하려면 해당 이미터의 Emitter Properties(이미터 프로퍼티)에서 Requires Persistent IDs(퍼시스턴트 ID 필요)를 활성화해줘야 합니다.
- 우선 콜리전(Collision) 모듈을 이미터에 추가해야 콜리전 이벤트 생성(Generate Collision Event) 을 해당 이미터에 추가할 수 있습니다. 이렇게 하면 이미터의 파티클이 월드의 오브젝트와 충돌할 수 있게 됩니다.
- Flow
EventHandler
- in receive emitter
- select specific [generate module] in detail pannel
EventHandler- same type with [generated event]
- Event
- Particle Spawn/Update에서 Event module 추가
- input param
- Particle Spawn/Update에서 Event module 추가
- MechanismNiagara System
- Overview Node ( system manager )
- Emitter ( include [Items] )
- Properties
- Render
- Stages ( Emt Sapwn / Emt update / Ptc Spawn / Ptc Update )
- Module
- Parameter
- Owner : Engine / System / Emitter / Particles / Stage transient / module output
- Type
- Primitive : 일반 변수타입
- Enum
- Struct
- Data Interface : 외부 데이터소스 ( api, datatable등 )
- Parameter
- Additional Stage
- Events ( → Event Handler )
- Simulation Stage
- Module
- GetMap(get Params value) → Adjust Action → SetMap(set Params value)
- module node based on bool / basic math / trigonometric / etc
- Concept : interaction between [Niagara Emitters] ( UE _ 이벤트 및 이벤트 핸들러 개요 )
- Note
- 이벤트는 현재 GPU 시뮬레이션과는 함께 작동하지 않고 CPU 시뮬레이션과만 함께 작동합니다.
- 이벤트를 사용하려면 해당 이미터의 Emitter Properties(이미터 프로퍼티)에서 Requires Persistent IDs(퍼시스턴트 ID 필요)를 활성화해줘야 합니다.
- 우선 콜리전(Collision) 모듈을 이미터에 추가해야 콜리전 이벤트 생성(Generate Collision Event) 을 해당 이미터에 추가할 수 있습니다. 이렇게 하면 이미터의 파티클이 월드의 오브젝트와 충돌할 수 있게 됩니다.
- Flow
EventHandler
- in receive emitter
- select specific [generate module] in detail pannel
EventHandler- same type with [generated event]
- Event
- Particle Spawn/Update에서 Event module 추가
- input param
- Particle Spawn/Update에서 Event module 추가
- MechanismNiagara System
- Overview Node ( system manager )
- Emitter ( include [Items] )
- Properties
- Render
- Stages ( Emt Sapwn / Emt update / Ptc Spawn / Ptc Update )
- Module
- Parameter
- Owner : Engine / System / Emitter / Particles / Stage transient / module output
- Type
- Primitive : 일반 변수타입
- Enum
- Struct
- Data Interface : 외부 데이터소스 ( api, datatable등 )
- Parameter
- Additional Stage
- Events ( → Event Handler )
- Simulation Stage
- Module
- GetMap(get Params value) → Adjust Action → SetMap(set Params value)
- module node based on bool / basic math / trigonometric / etc
- Concept : interaction between [Niagara Emitters] ( UE _ 이벤트 및 이벤트 핸들러 개요 )
- Note
- 이벤트는 현재 GPU 시뮬레이션과는 함께 작동하지 않고 CPU 시뮬레이션과만 함께 작동합니다.
- 이벤트를 사용하려면 해당 이미터의 Emitter Properties(이미터 프로퍼티)에서 Requires Persistent IDs(퍼시스턴트 ID 필요)를 활성화해줘야 합니다.
- 우선 콜리전(Collision) 모듈을 이미터에 추가해야 콜리전 이벤트 생성(Generate Collision Event) 을 해당 이미터에 추가할 수 있습니다. 이렇게 하면 이미터의 파티클이 월드의 오브젝트와 충돌할 수 있게 됩니다.
- Flow
EventHandler
- in receive emitter
- select specific [generate module] in detail pannel
EventHandler- same type with [generated event]
- Event
- Particle Spawn/Update에서 Event module 추가
- input param
- Particle Spawn/Update에서 Event module 추가
- MechanismNiagara System
- Overview Node ( system manager )
- Emitter ( include [Items] )
- Properties
- Render
- Stages ( Emt Sapwn / Emt update / Ptc Spawn / Ptc Update )
- Module
- Parameter
- Owner : Engine / System / Emitter / Particles / Stage transient / module output
- Type
- Primitive : 일반 변수타입
- Enum
- Struct
- Data Interface : 외부 데이터소스 ( api, datatable등 )
- Parameter
- Additional Stage
- Events ( → Event Handler )
- Simulation Stage
- Module
- GetMap(get Params value) → Adjust Action → SetMap(set Params value)
- module node based on bool / basic math / trigonometric / etc
- Concept : interaction between [Niagara Emitters] ( UE _ 이벤트 및 이벤트 핸들러 개요 )
- Note
- 이벤트는 현재 GPU 시뮬레이션과는 함께 작동하지 않고 CPU 시뮬레이션과만 함께 작동합니다.
- 이벤트를 사용하려면 해당 이미터의 Emitter Properties(이미터 프로퍼티)에서 Requires Persistent IDs(퍼시스턴트 ID 필요)를 활성화해줘야 합니다.
- 우선 콜리전(Collision) 모듈을 이미터에 추가해야 콜리전 이벤트 생성(Generate Collision Event) 을 해당 이미터에 추가할 수 있습니다. 이렇게 하면 이미터의 파티클이 월드의 오브젝트와 충돌할 수 있게 됩니다.
- Flow
EventHandler
- in receive emitter
- select specific [generate module] in detail pannel
EventHandler- same type with [generated event]
- Event
- Particle Spawn/Update에서 Event module 추가
- input param
- Particle Spawn/Update에서 Event module 추가
- Mechanism
- Event and Event Handler
- Niagara Module Flow
- Event and Event Handler
- Niagara Module Flow
- Event and Event Handler
- Niagara Module Flow
나이아가라 파라미터
- 시각화
- 파라미터 리스트
- System Attributes
- System : 해당 [나이아가라 시스템]의 attribute ( set active시 초기화 )
- Age ( float ) : 생성 후 경과 시간
- bCompoleteOnInactive ( bool ) : ?
- CurrentLoopDuration ( float ) : 설정된 루프 길이
- ExecutionState ( enum )
- awaken
- sleep and let particles finish
- sleep and clear particles
- kill immediately
- kill after particles fisnish
- ExecutionStateSource ( enum )
- LoopCount ( int ) : 총 루프 횟수
- LoopedAge ( float ) : 이번루프 경과 시간
- NormalizedLoopAge ( float ) : 이번루프 경과시간 백분위
- Emitter
- Age ( float )
- CurrentLoopDelay ( float ) : 루프사이 딜레이
- CurrentLoopDuration ( float )
- DistanceTraveled ( float )
- ExecutionState ( enum )
- ExecutionStateSource ( enum )
- LocalSpace ( bool )
- LoopCount ( int )
- LoopedAge ( float )
- NormalizedLoopAge ( float )
- DistanceFraction ( float )
- SpawnOutputInfo ( structure )
- SpawnRemainder ( float )
- Particle
- Particles.Age
- Color
- DistanceTraveled
- Initial Color
- System : 해당 [나이아가라 시스템]의 attribute ( set active시 초기화 )
- System Attributes
Niagara Fluid ( Grid )
- Runtime에 BP에서 flaot4 array 받아서 render target에 그리는 플로우
- https://www.youtube.com/watch?v=3fW5xjiDm-A
- - Manager BP에서 VectorArray를 Niagara에 보냄
- Niagara에서 받은 VectorArray를 RenderTarget에 Override ( 빈 에미터에서 GPU 계산으로 바꿀 것 )
- NiagaraFluids 플러그인 활성화
- 빈 Emitter에서 Grid2D하고 RenderTarget2D 파라미터를 생성, 받음
-> Grid2D는 2차원 데이터배열
- Emitter Spawn phase에서 Set grid,
<- RenderTarget(256x256 size, rendertarget user parameter에 user rendertargetparameter 넣기)
- Grid 2D Set Resolution ( data format을 half float ), Emiiter의 grid 연결 256, 256Scratch에 들어가는 parameter는 접두에 In / Out이 붙어야 함 - + stage ( generic simulation stage ) 3개, initialize / write to grid / write to texture
- iteration source = data interface, execute = always,
- - Manager BP에서 VectorArray를 Niagara에 보냄
커스텀 HLSL
int Out_Num;
InLocationsAndSizes.Length(Out_Num);
float NewGridValue = 0;
for(int Index = 0; Index <= Out_Num; Index++)
{
float4 Out_Value;
InLocationsAndSizes.Get(Index, Out_Value);
OutRGBA = Out_Value.z;
const float Distance = length(Out_Value - InGridLocation);
if(Distance < (Out_Value.w * InRadiusScale))
{
const float Falloff = (1 - (Distance/(Out_Value.w * InRadiusScale)));
NewGridValue = NewGridValue + Falloff;
}
}
OutRGBA = lerp(InRGBA, NewGridValue, InDeltaTime * 5);
'Unreal > UE Feature' 카테고리의 다른 글
Projectile & Spline (0) | 2024.05.17 |
---|---|
AI (0) | 2024.05.17 |
Texture (0) | 2024.05.17 |
Modeling (0) | 2024.05.17 |
Physics (0) | 2024.05.16 |