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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
1222 유니티 유니티 - 망치 타격 효과 연출 part2(한글자막) 금별 2025.10.11 548
1221 유니티 유니티 - 망치 타격 효과 연출 part1(한글자막) 금별 2025.10.11 631
1220 언리얼4 Create an Epic Rings Burst AOE FX in UE5 Niagara! (Full Tutorial) ashif 2025.09.25 627
1219 언리얼4 Create a Dynamic Sci-Fi Dome Material in UE5! (Full Tutorial) ashif 2025.09.24 548
1218 유니티 유니티/3DsMax - 깔끔한 기본 메시 검기 제작과정 part2(한글자막) 금별 2025.09.19 659
1217 유니티 유니티/3DsMax - 깔끔한 기본 메시 검기 제작과정 part1(한글자막) 금별 2025.09.19 695
1216 언리얼4 언리얼5 - 나이아가라 리본의 첫 트레일 프레임이 자연스럽게 나타나는 제작팁 금별 2025.09.19 852
1215 언리얼4 언리얼5 - [퀵팁] Niagara를 하나의 파라미터로 컨트롤과정 금별 2025.09.19 727
1214 유니티 언리얼5 - 심플한 솟아오르는형태 아우라 제작과정(한글자막) 금별 2025.09.19 718
1213 언리얼4 언리얼5 - 나이아가라 플루이드 2d Gas Smoke 기본조절 금별 2025.09.19 584
1212 언리얼4 린반 게임이펙트 라이브 - (취업준비편)포트폴리오 구성/주의사항/면접관련 각종팁들 금별 2025.09.19 825
1211 언리얼4 언리얼5 - Niagara로 번개와 표면 상호작용 VFX 만들기 금별 2025.09.03 1004
1210 언리얼4 언리얼5 - 간단한 바닥 아우라 색수차 효과를 추가 제작팁 금별 2025.09.03 889
1209 언리얼4 언리얼5 - Rotate Around Point 활용 궤도 애니메이션 연출 간단팁 금별 2025.09.03 751
1208 언리얼4 언리얼5 - halftone post-process 제작 예제 금별 2025.09.03 1403
1207 언리얼4 언리얼5 - 흡수 및 폭발 효과 간단 제작과정(한글자막) 금별 2025.09.02 1365
1206 언리얼4 언리얼5 - 회피 텔레포트 효과 간단제작과정(한글자막) 금별 2025.09.02 732
1205 언리얼4 언리얼5 - Stylized 화속성 검기 간단 제작 분석(한글자막) 금별 2025.09.02 846
1204 언리얼4 언리얼5 - 메시 조각 흡수 간단 제작과정(한글자막) 금별 2025.09.02 973
1203 언리얼4 유니티 - 고드름 형태 프리즈 셰이더 제작과정(한글자막) 금별 2025.09.02 754
1202 언리얼4 언리얼5 - Stylized 라이트닝 메쉬 제작과정(한글자막) 금별 2025.08.22 738
1201 언리얼4 언리얼/C4D로 만드는 모션그래픽 스타일 VFX 제작과정(한글자막) 금별 2025.08.22 678

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand