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등 )
      • Additional Stage
        • Events ( → Event Handler )
        • Simulation Stage

 

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
  • 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등 )
        • Additional Stage
          • Events ( → Event Handler )
          • Simulation Stage

    • 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
    • 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등 )
          • Additional Stage
            • Events ( → Event Handler )
            • Simulation Stage

      • 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
      • 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등 )
            • Additional Stage
              • Events ( → Event Handler )
              • Simulation Stage

        • 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
        • Mechanism
      • Event and Event Handler
      • Niagara Module Flow
    • Event and Event Handler
    • Niagara Module Flow
  • Event and Event Handler
  • Niagara Module Flow

 

나이아가라 파라미터

  • 시각화

 

  • 파라미터 리스트
    1. System Attributes
      1. System : 해당 [나이아가라 시스템]의 attribute ( set active시 초기화 )
        1. Age ( float ) : 생성 후 경과 시간
        2. bCompoleteOnInactive ( bool ) : ?
        3. CurrentLoopDuration ( float ) : 설정된 루프 길이
        4. ExecutionState ( enum )
          1. awaken
          2. sleep and let particles finish
          3. sleep and clear particles
          4. kill immediately
          5. kill after particles fisnish
        5. ExecutionStateSource ( enum )
        6. LoopCount ( int ) : 총 루프 횟수
        7. LoopedAge ( float ) : 이번루프 경과 시간
        8. NormalizedLoopAge ( float ) : 이번루프 경과시간 백분위
      2. Emitter
        1. Age ( float )
        2. CurrentLoopDelay ( float ) : 루프사이 딜레이
        3. CurrentLoopDuration ( float )
        4. DistanceTraveled ( float )
        5. ExecutionState ( enum )
        6. ExecutionStateSource ( enum )
        7. LocalSpace ( bool )
        8. LoopCount ( int )
        9. LoopedAge  ( float )
        10. NormalizedLoopAge  ( float )
        11. DistanceFraction  ( float )
        12. SpawnOutputInfo ( structure )
        13. SpawnRemainder ( float )
      3. Particle
        1. Particles.Age
        2. Color
        3. DistanceTraveled
        4. Initial Color

 

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, 


커스텀 모듈 : write to grid / write to texture

 

커스텀 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

Projectile

  • 기본적으로 root component가 static mesh면 제어
  • physics simul이 켜져있으면 초기속도만 제어
  • 안켜져있으면, 포물선 프로젝타일 운동을 모사함

 

Spline

  • Spline
    • 3차 베지어곡선에 기반하여, 위치/회전/법선등의 값을 유연하게 [그리기] 위한 기능
    • Get [Location/Rotation/Tangent] at distance along spline : spline의 특정 지점(start point로부터의 거리)의 값을 가져옴
    • Get [Location/Rotation/Tangent] at spline point : spline의 특정 지점(양자화된 노드 번호)의 값을 가져옴
  • SplineMeshComponent
    • Add spline mesh component : 새로운 메쉬컴포넌트 추가
    • start 와 end의 pos/tangent값을 설정하면, 그에맞춰 메쉬를 왜곡시켜주는 mesh ( mesh의 각 face에 대해 양측과의 거리비 기반의 weight로 pos/tangent 적용 하는것으로 보임 )

 

'Unreal > UE Feature' 카테고리의 다른 글

Niagara  (0) 2024.05.17
AI  (0) 2024.05.17
Texture  (0) 2024.05.17
Modeling  (0) 2024.05.17
Physics  (0) 2024.05.16

  • P : nav mesh visuallize

 

Character - (pawn_socket_aicontroller)AIController - (blueprint node_run behaviorTree) BehaviorTree - (taskNode)BTTask_blueprint(event_recieve_AI)

 

  • BehaviorTree
    • composite
      • Sequence
        • false return받을 시 즉시 false 반환하고 종료
        • 전부 true return시 true 반환하고 종료
        • 왼쪽부터 실행, False 반환받을 경우, 하위노드 처음부터 다시 실행
      • Selector
        • true return받을 시 즉시 true 반환하고 종료 
        • 전부 false return시 false 반환하고 종료
    • task
      • BTTask 상속된 BP 참조
      • BTTask로부터 return값을 받음
  • BTTask
    • return을 명시적으로 선언해줘야함 ( finish execute node )
      • success(bool) = 반환값

 

  • AI controller가 개입하기 위해서는, pawn이 movemtment component를 포함해야 함

'Unreal > UE Feature' 카테고리의 다른 글

Niagara  (0) 2024.05.17
Projectile & Spline  (0) 2024.05.17
Texture  (0) 2024.05.17
Modeling  (0) 2024.05.17
Physics  (0) 2024.05.16

UV

uv coord 기준

'Unreal > UE Feature' 카테고리의 다른 글

Projectile & Spline  (0) 2024.05.17
AI  (0) 2024.05.17
Modeling  (0) 2024.05.17
Physics  (0) 2024.05.16
(Character) Movement  (0) 2024.05.16

LandScape

  • 기본 단축키
    • 클릭/드래그 : 융기
    • shift + 클릭/드래그 : 침강

 

Modeling Tool

view port 활성화 → shift 5 혹은 모드 선택창에서 Modeling 선택

 

Shape : 도형을 그림

  • Modeling Pannel
  • Out Type : 메쉬 형태 ( Static / Volume / Dynamic )
  • Shape : 모델링의 형태 조절
    • "기본 크기" 설정(width, depth, height) : complete 시 현재 크기가 world scale에서는 1.f, 1.f, 1.f로 됨
    • subdivisions 설정 : 각 면을 몇개의 폴리곤으로 나눌 것인가
      • 폴리곤의 갯수는 품질, 퀄리티와 관련
      • 단순하게는 PolyModel에서 조절가능한 자유도에 해당 ( 버텍스와 폴리곤의 갯수 조절 )
      • material의 offset도 vertex 단위로 움직임 ( 아마 LOD 같은것들도 )
      • 곡선포함의 경우, 그냥 subdivision이라고 적힌건 "곡선부분을 몇개의 폴리곤(삼각형)으로 나눌지
    • Polygroup Mode : 아마 PolyModel에서 변형할 때, 어디까지 디테일하게 관리할지 인듯 ( quad : 폴리곤단위 / face : 면 단위 ( rotation.xy값을 공유하는 폴리곤 집단 ) / shape : 통짜로만 조작 )
  • Asset
    • Instance if possible : 기본적으로 modeling 하나 만들때마다, Contents내 Generate 파일에 블루프린트가 하나 생성되는데, 설정 똑같은걸로 여러개 설치할 경우, 하나의 블루프린트로 나눠쓸것인지 선택 여부
      • 기본 로케이션 ( autogen folder _ world relative ) 기준 path%BP_Level%/_Generated/컴퓨터이름/파일생성위치

 

  • Positioning : view port에 설치할 때 도움주는 항목
    • Target surface : 마우스기준으로 설치하는데, 마우스가 object위에 있으면, object의 면에 설치할 것인지(On scene) vs 관통하고 ground(아마 z축값 0 인듯) 에 설치할 것인지
    • Snap to Grid : 설치 시 그리드(양자화) 적용 여부
    • Pivot Location : 피봇 위치
    • Rotation : 회전값
    • Align to Normal : 설치면의 법선벡터 반영 여부 ( target surface가 object=onscene일 경우, 기울어져 있을 수 있는데, 그럴 경우 대상을 기울어지게 설정할 것인지
  • Material
    • material : 적용할 마테리얼
    • UV Scale : 텍스쳐의 스케일 배율 ( 1, 1 = 모델링의 면과 텍스쳐의 크기가 1:1로 대응 )
    • World Space  : 텍스쳐를 고정크기로 적용할지, Object 크기로 적용할 지 ( 설치 전 Width/Depth/Heigth를 통한 크기변화에만 적용 됨 )
    • show wireframe : 버텍스를 와이어프레임으로 보여줌

 

Create : 자유도형을 그림

  • PolyExt : 다각도형 그린 다음 높이 조절
  • Path Ext : 경로 그린다음 넓이, 높이 조절 ( 경사 생성 가능 )
  • PathRev : 면 그린다음 회전시킴revolve ( 도자기 굽기, 높이에 델타값 줘서 나선도 가능 )
  • BdryRev : 설치한 오브젝트의 "한 면"을 기반으로 회전시킴revolve
  • MshMrg : 설치된 오브젝트중 두 개 이상을 하나로 합침
  • MshDup : 오브젝트를 복사하는데, 상태를 바꿀 수있음 ( 또 뭔가 기능 있었는데 )
  • 디테일
    • Freehand / Interactive : 설치할 때 마우스 조절해가며 설치

PolyModel : 설치된 모델링 변형

  • PolyEd : 설치된 모델링의 버텍스들 위치 수정
  • PolyDef : Ed보다 덜 구체적, 빠르게?
  • CubeGr : 지면 기준으로 대상 자르기 좋음

Transform

  • XForm
  • Pivot
  • Split

Deform

  • 텍스쳐 기반으로 모델링 변형

MeshOps

remesh : 폴리곤 갯수 재조정

'Unreal > UE Feature' 카테고리의 다른 글

Projectile & Spline  (0) 2024.05.17
AI  (0) 2024.05.17
Texture  (0) 2024.05.17
Physics  (0) 2024.05.16
(Character) Movement  (0) 2024.05.16

컬리전 매트릭스

2개의 object가 서로에 대해 다른 collision 판정을 가지고 있을 때, 더 낮은 충돌단계를 적용

  Object A
Ignore Overlap Block
Object B Ignore Ignore Ignore Ignore
Overlap Ignore Overlap Overlap
Block Ignore Overlap Block

 

 

관련 프로퍼티

Transform Mobility

  • static
  • stationary
  • movable

 

Physics

  • simulate physics ( bool )
  • mass ( kg )
  • force ( N )
  • enable gravity ( bool )
  • constraints

 

 

 

interaction query

  • collide
  • chaos

 

add force

  • crash and physics sim
  • add force ( continuous )
  • add impulse ( 1 frame )
  • damping / friction

 

calc force

  • constraint
    • physics stat ( 축제어 회전3자유도 + 이동3자유도 )
    • constraint component
  • Ignore
    • FieldSystem → kill / sleep
    • transform mobility = static / stationary

 

apply velocity

 

'Unreal > UE Feature' 카테고리의 다른 글

Projectile & Spline  (0) 2024.05.17
AI  (0) 2024.05.17
Texture  (0) 2024.05.17
Modeling  (0) 2024.05.17
(Character) Movement  (0) 2024.05.16

참고자료

 

 

Character Movement 기본 구조

 

Character Movement 네트워크 구조

Architecture & Example

 

클라이언트 / 서버 파이프라인
  • Check or Input Vector ( from controller.h → [Possess Actor or Binded? ] movementComponent.h? )
  • Controlled Character Move (State adjust) ( movementComponent.h → [movementComp→UpdatedComponent] collisionComponent(or any component which have Location)]
    • delta Time + input Vector 
    • [Input] Vector → [Output] Acceleration ( temporary )
  • Perform Move
    • calc Acceleration → force/Impulse
  • Start New Physics
    • calc force/Impulse → velocity → location ( depend on movement Mode )

 Character movement compoent 구성

하위프로퍼티 변경 -> 물리처리 phase에서 movement mode체크 -> 해당 movement mode의 연산식에의해, 상위프로퍼티 산출 -> movement

 

movement mode

  • character movement component → movement mode
    • 틱마다 호출 ( movement mode == phys_... )
      • Tick → (root motion, movement, etc...) → StartNewPhysics → <UEnum> MovementMode → Phys{None/Walking 등등}
    • Mode 전환 호출
      • SetMovementMode( movementmode, custom enum )
    • 변환시 처리
      • OnMovementModeChanged
        • prev movement mode를 기반으로 종료되는 mode에 대한 처리
        • 만약 시작될때를 기점으로 하고싶다면, setmovementmode가 호출되는 조건 ( IsClimbing등 별도 변수 )를 기준으로 사용하는 듯

 

 

 

Add Force

더보기
void UCharacterMovementComponent::AddForce( FVector Force )
{
    if (HasValidData() && !Force.IsZero())
    {
        if (Mass > SMALL_NUMBER)
        {
            PendingForceToApply += Force / Mass;
        }
        else
        {
            UE_LOG(LogCharacterMovement, Warning, TEXT("Attempt to apply force to zero or negative Mass in CharacterMovement"));
        }
    }
}

 

[Character] BP에서 movementComponent는 root component를 제어함

  • ACharacter class에서 할당
더보기
ACharacter::ACharacter(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
    // ...
 
    RootComponent = CapsuleComponent;
 
    // ...
 
    CharacterMovement = CreateDefaultSubobject<UCharacterMovementComponent>(ACharacter::CharacterMovementComponentName);
    if (CharacterMovement)
    {
        CharacterMovement->UpdatedComponent = CapsuleComponent;
        CrouchedEyeHeight = CharacterMovement->CrouchedHalfHeight * 0.80f;
    }
 
    // ...
 
}

 

프레임 내 최종 위치 결정 순서

 

'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

+ Recent posts