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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
1179 언리얼4 Unleash the Dark: Crafting a Black Smoke Character with Unreal Engine ashif 06.02 30
1178 언리얼4 언리얼5 - Sci-fi 격자 지형 균열 VFX 제작과정(한글자막) 금별 05.30 109
1177 언리얼4 언리얼5 - 레이저 반사 VFX 제작과정(한글자막) 금별 05.30 79
1176 유니티 유니티/맥스/포토샵 - 간단한 큐브 애니메이션 효과 제작예제(한글자막) 금별 05.30 68
1175 언리얼4 Cursed Mask FX: Crafting Skull, Glowing Rings & Red Smoke in Unreal Engine 5 Niagara ashif 05.29 71
1174 언리얼4 Transform Basic Fire into Epic Flames in Unreal Engine 5 Niagara ashif 05.28 73
1173 언리얼4 Step-by-Step Guide: Healing Aura Effect in Unreal Engine 5 Niagara ashif 05.27 81
1172 언리얼4 Master Blood Eruptions in UE5: A Step-by-Step VFX Guide ashif 05.26 80
1171 언리얼4 언리얼 - 1,2개의 축을 제어하는 월드 기반 회전 예제 금별 05.26 86
1170 유니티 유니티 - 그라디언트 맵으로 실시간 VFX 제작하기(한글자막) 금별 05.26 111
1169 언리얼4 Create Mesmerizing Magnetic Fields in UE5 Niagara: A Step-by-Step Guide ashif 05.23 117
1168 3D 3DS Max - 직각 Sword Slash 메쉬 제작방법 금별 05.23 114
1167 언리얼4 Step-by-Step Guide to Dynamic Trails in UE5: Elevate Your Game VFX! ashif 05.22 132
1166 언리얼4 언리얼/후디니 - 코페르니쿠스 시뮬레이션 데칼을 언리얼에서 활용하는법(한글자막) 금별 05.21 151
1165 언리얼4 언리얼5 - 죽음 디졸브 이펙트 Niagara SkeletalMesh Location 사용 금별 05.21 144
1164 언리얼4 후디니/언리얼 - 유체 및 불규칙한 동적 오브젝트를 UE로 내보내는 두 가지 방법 – ABC와 버텍스 애니메이션 금별 05.20 151
1163 유니티 유니티 - 음률 리듬 VFX 제작 가이드(한글자막) 금별 05.20 159
1162 유니티 유니티 - 별빛 VFX: 단계별 제작 가이드(한글자막) 금별 05.20 182
1161 유니티 유니티 - Ice Cone과 Spike 제작 가이드(한글자막) 금별 05.20 150
1160 유니티 유니티 - 입체 오각형/육각형 텍스처와 모델 제작 가이드(자막) 금별 05.20 136
1159 언리얼4 언리얼5 - Burn Transition Material 예제 및 노드 금별 05.18 148
1158 언리얼4 언리얼5 - 커스텀 노드를 활용한 줌블러 예제 및 코드 금별 05.18 151

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand