유니티 - Custom Vertex Stream and Shadergraph/Amplify Shader



유니티 - Custom Vertex Stream and Shadergraph/Amplify Shader

금별 0 8,573 2019.12.29 23:02

 

 

 

Since few weeks, I saw many questions about ’ Custom Vertex Stream ’ (called CVS here) on Shuriken with Shadergraph/Amplify Shader

First, here a really good post about CVS by Mirza Beig where a lot of things are explains : http://www.mirzabeig.com/tutorials/intro-to-custom-particle-vertex-streams/ 102

I will only tacle how to link CVS and Shadergraph/Amplify Shader!

Here the shader we will use for Shadergraph:

 

Base_Shader


And here the shader we will use for Amplify Shader:

 

Base_Amplify

 

1: UV channel selector, the first important part in the shader
2: RGBA split component, the second important part!
The only difference between the two shadernode editors is the uv channel:
Shadergraph starts at 0
Amplify starts at 1

Let’s go to Shuriken now ! We add a new material with the shader we created in Shuriken renderer.
The setup is the simpliest as possible, only one particle and only the one ’ Custom Data ’ in CVS (we can’t delete the Position!)

 

Shuriken

 

1: Enable CVS and add a Custom1.xyzw data

 

Shuriken_1

 

2: Enable ’ Custom Data ’ module, set the Custom1 to Vector and 4 component

Custom1 is setup like that:
X : Start at 1 and decrease to 0 at midlife
Y : Start at 0 and at midlife go to 1
Z : Const 0
W : Const 0

And here the result you should have:

 

Result_1

 

Let’s describe a bit what happens!

 

Liens


CVS and Custom Data :

- It’s simple, the Custom1 in CVS is the Custom1 in Custom data. You can animate here the XYZW component with const, curve or color.
CVS and Shadergraph/Amplify :

- Near Custom1 in CVS, we can see Unity give us a tip on how to link that in Shadergraph/Amplify with (TEXCOORD0.xyzw). TEXCOORD is our UV channel and the 0 say it’s our first UV channel.
We can resume with this array

Array

 


But what if we have more data to send ? Our best friend become the number near TEXCOORD
Here a case :

 

many


In resume we have:

- TEXCOORDX = UV channel X for Shadergraph and UV channel X+1 for Amplify.
- XYZW = RGBA for Shadergraph and UVWT for Amplify
One particular thing we see with StableRandom.xyzw is the TEXCOORD2.yzw**|**x
Unity wants to say us ’ StableRandom.xyzw starts in TEXCOORD2.yzw and finishes in the next one,TEXCOORD3.x ’


And here we go! We can now make crazy SHEBAM ! POW ! BLOP ! WIIIZZ !
I hope this can help, forgive me my language mistakes, don’t hesitate to correct me to make this a bit clearer or add/remove/correct any informations!

 

 

 

 

 

Another User example

 

image

Using this feature you can make texture panning from curve x if you have UV output Z(W in amplify). It will be one curve for your Z value and panning. I don’t know where you can use it, but anyway…

image
or you can make random texture coordinates using StableRandom

image

Tangent need when you use normal map in the shader.
Put like on this comment if you found out about it for the first time

 

 

One simple way is setting your colors as HDR in shadergraph

 

image

 

and use AgePercent to Lerp between the color

 

image


The only counterpart is if you want 4 different colors over the particule life, you will have to declare 4 colors :


 

image

 

Here the result :

 

test

In few words, each smoothstep provide a [0-1] value to lerp between the different colors.
The smoothstep range is define by [1 / 3 (numberOfSmoothstep)]

- for the first one you have [0 => 0.33]
- the seconde one : [0.33 => 0.33 * 2]
- the last one : [0.33 * 2 => 0.33 * 3]

I hope it’s what you’re looking for in a way!
And here the shader for example (you can see the setup for shuriken in the gif). Sorry, i don’t know how to add commentary in shadergraph… and it’s look like it’s impossible for the moment!

 

https://drive.google.com/file/d/19oafzIyZIg3qzvszjFwKc0z7ZHYOiPUZ/view

 

If someone have a simplier solution to have HDR color over lifetime, you must speak! now! 

 

Comments


번호 포토 분류 제목 글쓴이 날짜 조회
1292 언리얼4 UE5 Niagara Tutorial: Advanced Summoning Ring FX ashif 01.15 22
1291 언리얼4 언리얼 - 나이아가라 Advanced Guide – 위치 기반 동역학 금별 01.09 94
1290 언리얼4 Niagara로 생성된 Static Mesh에서 파티클 스폰하기 금별 01.09 96
1289 언리얼4 언리얼 - 나이아가라로 스플라인을 따라 발사되는 파티클 제작 금별 01.09 85
1288 언리얼4 언리얼5 - 어검술의 완성 : 검진(Sword Array) 심화 기동 및 고급 제어(한글자막) 금별 01.09 96
1287 언리얼4 언리얼5 - 벡터 연산을 활용한 검진(Sword Array) 지정 방향 발사 로직(한글자막) 금별 01.09 79
1286 언리얼4 언리얼5 - Particle Reader를 활용한 검진(Sword Array) 타겟 추적 및 회전 제어(한글자막) 금별 01.09 53
1285 언리얼4 언리얼5 - 파티클 Index를 활용한 원형 검진(Sword Array) 배치 제작과정(한글자막) 금별 01.09 60
1284 언리얼4 언리얼5 - VHS 포스트 프로세스 제작과정 금별 01.09 59
1283 언리얼4 언리얼5 - 데드 스페이스 VFX reborn[팬메이드] 금별 01.09 64
1282 언리얼4 Simple Light Aura VFX in UE5 Niagara Tutorial ✨????️???? ashif 01.08 60
1281 언리얼4 Heat Distortion VFX for Fire in UE5 Niagara! (Photoshop & Normal Map Workflow) ????????✨ ashif 2025.12.16 202
1280 2D 섭스턴스 디자인 - 색수차(Chromatic Aberration) 매직 오라 텍스처 만들기(한글자막) 금별 2025.12.16 246
1279 언리얼4 언리얼 - 미호요 신작 스타일 Depth Fade와 UV 조작을 이용한 공간 포털 연출(한글자막) 금별 2025.12.16 338
1278 언리얼4 언리얼5 - Polar Coordinates를 활용한 태극 무늬 제작 금별 2025.12.16 181
1277 언리얼4 언리얼 - AAA 게임 개발에서의 나이아가라 모듈(Niagara Module) 연구 및 적용 금별 2025.12.16 220
1276 유니티 유니티 - 유니티 스플라인 카메라 무브먼트 예제(워프 효과 연출) 금별 2025.12.16 174
1275 언리얼4 언리얼 - 간단한 스타일라이즈드 불효과 제작과정팁 금별 2025.12.16 176
1274 언리얼4 Simple Stylized Tornado VFX in UE5 Niagara! (Torus Mesh, Erode & Dynamic Params) ????️????✨ ashif 2025.12.15 133
1273 2D 섭스턴스 디자인 - 움푹 파인 바닥 절차적 제작과정(한글자막) 금별 2025.12.10 180
1272 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part3(한글자막) 금별 2025.12.10 187
1271 언리얼4 언리얼 - Stylized 파도/물보라 제작과정 part2(한글자막) 금별 2025.12.10 134

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand