Unrea Engine Graphic

Unreal Engine PCG Detail (2) - Foliage, Parameter (1)

DB51 2025. 3. 14. 18:04

 

 

PCG Foliage

 

Surface Sampler 생성

 

Surface Sampler Settings

 - Foliage의 크기에 맞춰 Point Extents를 조절

 

 

 

Static Mesh Spawner에 Foliage로 사용할 Static Mesh 적용

 

 

Mesh Selector - Mesh Entries - Descriptor - Collision Presets - NoCollision 으로 설정

(기본적으로 Foliage에 충돌이 들어가지 않기 때문)

 

 

Transform Points를 추가하여 변형, Surface Sampler을 통해 배치 양 조절

 

 

 

Difference를 사용하여 이전 PCG에 사용한 Static Mesh와 같이 배치

 

 

 

 

 

 

 

 

 

Scale Multiplier (Foliage Scale Parameter 만들기)

PCG 창에서 스케일을 조절하지 않고 Parameter을 통해 조절

 

Graph Settings

 

Graph Settings - Instance - Parameters에서 변수 생성

(float로 생성)

 

Multiply 노드 연결

 

Multiply의 Input, Output Source 설정

('$'는 기존에 있는 속성을 표기)

 

 

Level에서 PCG 선택 - Details에서 PCGComponent 선택 - Instance - Parameters Overrides

(Foliage Scale Multiplier 값 변경으로 스케일 조절)

 

 

Result

Foliage Scale Multiplier 1.0

 

Foliage Scale Multiplier 2.0

 

 

 

 

다른 StaticMesh의 Parameter 제작

 

 

 

 

 

 

 

 

Static Mesh 종류를 바꾸는 Parameter

 

Graph Settings -  - Instance - Parameters에서 변수 생성

변수 종류 : Static Mesh (Object Reference)

 

생성된 변수를 Single에서 Array로 변경하여 다수의 변수로 변경

 

변수 설정 전 Match And Set Attributes 노드와 변수 노드 추가

 

Match And Set Attributes - ✓ Inspect 하여 Attribute 확인

Attribute의 마지막 칸에 생성한 변수 (TreeMeshs) 칸이 생성된다

 

 

Static Mesh Spawner - Mesh Selector Type을 Weighted에서 ByAttribute로 변경한다

 

 

Attribute Name에 Attribute창에 뜬 Parameter 이름을 입력

 

 

 

에디터에서 PCG 선택, Detail - PCGComponent - Parameter Override에서 Parameter element 추가 가능

 

 

Result

 

 

 

 

 

 

 

Attribute에서의 순서도 설정

Structure 폴더 생성 - Blueprint - Sturcture 생성

 

 

F_MeshInformation

Structure

Parameter 생성 ( Mesh (StaticMesh - Object Reference), Weight (Float) )

 

Default Values

Weight : 1.0

 

 

Match And Set Attributes의 변수 삭제

 

 

Graph Settings - Instance - Parameters에서 해당 Parameter의 유형을 제작한 구조체 블루프린트로 변경

 

 

Parameter 이름 변경 (TreeMeshInformation)

* PCG 그래프에 오류 경고 표시가 뜨지 않도록 적어도 한 가지 Element를 가지고 있어야 한다

 

변수 (TreeMeshInformation)를 Match And Set Attributes에 연결

 

 

변수에 ✓ Inspect하여 Attribute 확인

Mesh, Weight 생성된 변수의 Attribute 화면

 

 

Match And Set Attributes에 ✓ Inspect하여 Attribute 확인

Mesh, Weight 생성된 Match And Set Attributes의 Attribute 화면

 

 

Match And Set Attributes - Settings -  ✓ Match Weight Attribute에 변수 이름 (Weight) 입력

 

 

Static Mesh Spawner - Mesh Selector - Attribute Name에 변수 이름 (Mesh) 입력

 

 

 

에디터에서 PCG 선택, Detail창을 통해 PCGComponent - Parameter Override에서 Mesh, Weight 조절 가능

 

 

 

 

 

 

 

다른 Static Mesh에 구조체 블루프린트 적용하기

 

Graph Settings를 통해 변수 생성

 

 

Rock

 

Foliage

 

 

 

 

PCGComponent에 추가된 Mesh, Weight