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



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

금별 0 957 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


번호 포토 분류 제목 글쓴이 날짜 조회
공지 외국 교육 이펙트 튜토리얼 모음(사이트/유튜브/비메오등등..) 댓글+4 금별 2018.05.12 1739
공지 이펙트 추천 사이트/블로그 댓글+6 금별 2018.05.12 2905
159 언리얼4 200 Unreal Engine Niagara Tutorials | 200 Real Time VFX Tutorials ashif 08.09 9
158 언리얼4 Firy Dissolve Effect in Unreal Engine Material Editor ashif 08.08 12
157 유니티 유니티 쉐이더그래프 - 노이즈 관련 이미지 팁 금별 08.06 21
156 언리얼4 Smoke in UE4 Niagara Pack01 in Unreal Engine Marketplace ashif 08.05 12
155 언리얼4 Fire character Effect | Unreal Engine Niagara Tutorials | UE4 Niagara Flame boy ashif 08.03 21
154 유니티 유니티 - 매직 카드제작 트릭팁 금별 08.02 46
153 언리얼4 Eye of Sauron from The Lord of the Rings | Unreal Engine Niagara Tutorials | UE4 Niagara Eye FX ashif 07.31 41
152 언리얼4 언리얼4 - 머터리얼에서 양면 렌더링 방법 금별 07.30 51
151 언리얼4 언리얼4 - Vertex(정점) Offset 흡수 효과 금별 07.30 71
150 유니티 유니티 앰플리파이 쉐이더 이펙트 - 물속성+불속성 토네이토 금별 07.30 50
149 언리얼4 Bubble Burst Effect | Unreal Engine Niagara Tutorials | UE4 Niagara Bubble Burst ashif 07.30 21
148 언리얼4 언리얼4 나이아가라 - 트레일관련 미니팁 금별 05.30 157
147 유니티 유니티 - 기어즈5 Hammer of Dawn 이펙트 만들기 금별 05.16 142
146 유니티 포토샵으로 디졸브 쉐이더를 사용해 2D 툰이펙트 제작팁 댓글+2 금별 05.16 361
145 언리얼4 언리얼4 이펙트 튜토리얼 - 애펙을 사용한 트랜지션 효과 만들기 금별 04.01 242
144 유니티 유니티 URP 쉐이더그래프 팁 - 블러만들기 금별 04.01 196
143 유니티 유니티 HDRP에서 소규모 고품질의 영상 제작 - Unite Tokyo 2019 금별 03.29 185
142 3D Visual Effects Bootcamp: The Rise of Realtime 금별 03.26 95
141 언리얼4 언리얼4 머터리얼 튜토리얼 - Procedural 노이즈제작 금별 03.26 126
140 언리얼4 언리얼4 머터리얼 팁 - 머터리얼만으로 밴드형태 구현하기 금별 03.26 114
139 언리얼4 언리얼4 머터리얼 팁 - 머터리얼만으로 트위스트 구현하기 금별 03.26 119
138 유니티 유니티 쉐이더 그래프 - Orthographic 뎁스 금별 03.26 131


Banner
Facebook Twitter GooglePlus KakaoStory NaverBand