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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
540 언리얼4 언리얼 - Advanced Scan Effect 제작 튜토리얼 금별 2023.07.31 2383
539 유니티 유니티 - 빔 이펙트 제작 튜토리얼 금별 2023.07.31 3894
538 언리얼4 언리얼 - 자연스런 UV 울렁거림 제작예제 금별 2023.07.31 2684
537 2D (짧은팁)윈도우 자체 그레이스케일모드 설정법 금별 2023.07.27 2326
536 유니티 유니티 VFX 그래프 - 라이트닝 스트라이크 VFX 제작과정 금별 2023.07.27 3905
535 언리얼4 언리얼5 - 시퀀서 활용 특정 동작 슬로우 모션 제작방법 금별 2023.07.26 3877
534 언리얼4 UE5 | AOE in Unreal Engine 5.2 Niagara Tutorial | Download Files ashif 2023.07.26 2740
533 언리얼4 언리얼 간단팁 - 메쉬외각 엣지 흔적 정리 금별 2023.07.20 3159
532 언리얼4 언리얼 - 머트리얼 노드 정렬 단축키 팁 금별 2023.07.20 4877
531 유니티 유니티 - 카툰풍 메시 검기 제작과정 금별 2023.07.20 3650
530 유니티 유니티 - 화염검기 제작과정 금별 2023.07.18 2696
529 2D 포토샵 - 페인트 먹물느낌의 검기 텍스쳐 제작과정 금별 2023.07.18 3431
528 유니티 유니티 쉐이더 그래프 - 지형 스캐너 이펙트 제작과정 금별 2023.07.13 2811
527 언리얼4 Unity Dev Weeks 2023: 서머너즈 워: 크로니클에서 사용한 렌더링기법과 최적화 기능개발 과정 금별 2023.07.11 2637
526 언리얼4 언리얼 - 라이트닝 이펙트 제작과정 금별 2023.07.10 2594
525 언리얼4 언리얼 - 마법진/문자 인트로 영상 제작과정 금별 2023.07.10 2358
524 언리얼4 언리얼/섭스턴스 디자인 - 화염 크랙 제작과정 금별 2023.07.10 2700
523 유니티 유니티 - 빙속성 광역 공격 효과 제작과정 금별 2023.07.10 3112
522 언리얼4 언리얼 - 스파이더맨에 나온 글리치 효과 제작과정 금별 2023.07.07 2547
521 언리얼4 언리얼 - 하트 모양의 파티클 이동 간단 제작과정 금별 2023.07.06 3803
520 언리얼4 언리얼 - 커스텀 데칼 UVs 사용예제(WorldPositionBehindTranslucency활용) 금별 2023.07.04 3182
519 언리얼4 언리얼 - (간단팁)채널 선택 및 믹싱에 내적 사용방법 금별 2023.07.04 2842

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand