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



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

금별 0 8,379 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


번호 포토 분류 제목 글쓴이 날짜 조회
1260 언리얼4 언리얼5.7기준 - 나이아가라의 확장성 및 모범 사례 금별 11.17 54
1259 언리얼4 언리얼 - Niagara로 스플라인을 따라 발사되는 파티클 제작하기 금별 11.17 48
1258 언리얼4 언리얼5 - 오브젝트를 풍경에 혼합하기: 런타임 가상 텍스처 사용법 금별 11.17 47
1257 언리얼4 언리얼5 - 동적 SubUV 데칼(Decal) 제작하기 금별 11.17 41
1256 언리얼4 언리얼 - 리본 VFX 설명_색상·너비·왜곡 커스텀 제작과정(한글자막) 금별 11.15 67
1255 언리얼4 Create a Dark Energy Orb VFX in UE5 Niagara! (Warped Cage, Dynamic Rings & Core Glow Tutorial) ????????✨ ashif 11.13 71
1254 언리얼4 언리얼5 Material 업데이트 요약 (UE 5.6 ~ 5.7 및 미래 전망) 금별 11.11 158
1253 유니티 유니티 - ASE 활용 Stylized 폭발 과정(한글자막) 금별 11.11 140
1252 유니티 유니티 - Stylized 불꽃 픽셀화 간단 제작과정(한글자막) 금별 11.11 147
1251 3D 마법진 눈알 움직임 연출 예제 금별 11.11 144
1250 언리얼4 언리얼5 - 커스텀 노드: UV 스케일 및 이동(Scale & Translate) 직접 만들기 금별 11.11 129
1249 유니티 유니티 - ASE로 UV Flow + Noise 흔들림 기본 VFX 셰이더 제작과정(한글자막) part3 금별 11.05 154
1248 유니티 유니티 - ASE로 UV Flow + Noise 흔들림 기본 VFX 셰이더 제작과정(한글자막) part2 금별 11.05 122
1247 유니티 유니티 - ASE로 UV Flow + Noise 흔들림 기본 VFX 셰이더 제작과정(한글자막) part1 금별 11.05 133
1246 언리얼4 언리얼/3Ds Max - 우주 느낌의 하트 제작_2 머트리얼 적용과정 금별 10.28 252
1245 언리얼4 언리얼/3Ds Max - 우주 느낌의 하트 제작_1 모델링/UV 제작과정 금별 10.28 174
1244 언리얼4 후디니/언리얼 - 후디니 활용 절차적(프로시졀) 검기 메시,텍스쳐 VFX 제작 기법(한글자막) 금별 10.28 183
1243 언리얼4 언리얼5 - 음파 VFX 제작: Niagara Particle과 기본 Scene 제작 금별 10.28 192
1242 언리얼4 언리얼5 - 음파 VFX 제작: Material 연결과 원리 분석 금별 10.28 154
1241 언리얼4 언리얼5 - 음파 VFX 제작: 모델링과 텍스처 기초 금별 10.28 157
1240 언리얼4 언리얼5 - 디지털 트랜지션 생성 및 파티클 픽셀화 제작과정(한글자막) 금별 10.22 213
1239 언리얼4 언리얼 - 데몬슬레이어 아카자 스킬 VFX 분석 금별 10.22 238

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand