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



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

금별 0 6,850 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


번호 포토 분류 제목 글쓴이 날짜 조회
1157 언리얼4 언리얼 - 나이아가라 캐쉬 간단 사용방법 금별 05.12 30
1156 언리얼4 Unleash the Magic: Crafting Material Spells in UE5 Niagara ashif 05.10 46
1155 언리얼4 Create Stunning Ghost Trails in Unreal Engine 5 with Niagara ashif 05.09 52
1154 언리얼4 Create a Sci-Fi Forcefield Shield in Unreal Engine 5: A Complete Guide ashif 05.08 72
1153 언리얼4 Create Stunning Lightning Orbs in Unreal Engine Niagara: Step-by-Step Tutorial ashif 05.02 134
1152 언리얼4 언리얼5 - UV 조작으로 만드는 동적 그래픽(더빙) 금별 04.29 232
1151 언리얼4 언리얼 - 페이지 넘긴 효과 머트리얼 구현과정 금별 04.29 168
1150 언리얼4 Create Spell in UE5 Niagara Tutorial ashif 04.25 164
1149 언리얼4 언리얼 - 간단한 Procedural Dissolve제작노드 금별 04.25 208
1148 언리얼4 에픽 라이브 - 스타일라이즈드 번개 이펙트 만들기(린반) 금별 04.25 181
1147 3D 블랜더 - 머트리얼만으로 촛불효과 제작노드 금별 04.25 144
1146 언리얼4 언리얼 - 머티리얼/포스트 프로세스 피쉬아이 형태 노드구성 금별 04.25 161
1145 언리얼4 Rays Material MAGIC on Skeletal Mesh in Unreal Engine 5 ashif 04.24 144
1144 언리얼4 언리얼/Houdini로 구현하는 Shatter 효과: 3D 모델링과 애니메이션으로 완성하는 언리얼 워크플로우(자막) 금별 04.22 175
1143 언리얼4 언리얼5 - 머트리얼 디자이너를 활용한 간단한 잔물결 제작과정(더빙) 금별 04.03 287
1142 언리얼4 Magical Shield in Unreal Engine 5 Niagara Tutorial ashif 04.02 223
1141 언리얼4 언리얼5 - 토네이도 효과 제작과정 part2(더빙) 금별 04.02 199
1140 언리얼4 언리얼5 - 토네이도 효과 제작과정 part1(더빙) 금별 04.02 201
1139 언리얼4 Totem Spawn FX in Unreal Engine 5 Niagara Tutorial ashif 03.24 231
1138 언리얼4 언리얼 - 바닥에 Clamp 되는 머티리얼 예제 금별 03.23 314
1137 유니티 유니티 - 컷신 VFX 워크플로우 예제 금별 03.23 348
1136 언리얼4 간단한 Houdini에서 언리얼5 나이아가라로 이펙트 변환 가이드(한국어더빙) 금별 03.23 281

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand