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



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

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


번호 포토 분류 제목 글쓴이 날짜 조회
827 언리얼4 Portal to the Dark World in UE5.4 Niagara | For Patreon ashif 05.04 16
826 언리얼4 언리얼 - 프로시졀(절차적) Light spot 머트리얼함수 제작과정(한글자막) 금별 05.03 21
825 언리얼4 언리얼 - 포토샵을 활용한 경로 그라데이션 효과 제작과정(한글자막) 금별 05.03 18
824 언리얼4 언리얼 - 메카봇 파괴 효과 간단 제작과정 금별 05.03 28
823 언리얼4 언리얼5 - 나이아가라 리본을 활용한 단순한 거미줄 효과 제작과정(한글자막) 금별 05.03 22
822 언리얼4 언리얼5 - 쉴드에 의한 다중 발사체 임팩트 효과 제작과정(한글자막) 금별 04.29 58
821 언리얼4 언리얼5.4 - 신기능 텍스쳐 그래프 기본적인 설명(한글자막) 금별 04.29 64
820 언리얼4 언리얼5 - 나이아가라 스파크 제작과정(한글자막) 금별 04.29 46
819 언리얼4 언리얼5- 나이아가라 연기 임팩트 효과 제작과정(한글자막) 금별 04.29 39
818 언리얼4 언리얼5 - Sci-Fi Barrier 제작과정(한글자막) 금별 04.29 38
817 유니티 유니티 셰이더/렌더링 에센스 - 첫 URP 작성해보기 금별 04.29 38
816 유니티 유니티 셰이더/렌더링 에센스 - 유니티 셰이더 컴파일 & 셰이더 컴파일레이션(retr0) 금별 04.29 34
815 언리얼4 언리얼/유니티/고돗엔진 - 셰이더 최적화 간단팁(한글자막) 금별 04.26 67
814 유니티 유니티 앰플리파이 셰이더 - HotWater셰이더 GUI 및 자료사용 예제 영상 금별 04.26 58
813 유니티 유니티 - 쿠파 취업 클래스 [실강의 맛보기 - 얼음스킬제작과정] 금별 04.26 52
812 3D 이펙트의 모든것! 게임직 TA 김용남 인터뷰_01 금별 04.24 71
811 언리얼4 언리얼5 - HLSL을 활용한 이미지 블러 효과 제작과정(한글자막) 금별 04.24 79
810 언리얼4 언리얼5 - 아티스트를 위한 흥나는 프로파일링!: RenderDoc 금별 04.24 71
809 3D 메쉬 UV패닝을 활용한 곡선 트레일 제작짧은팁 금별 04.22 89
808 언리얼4 언리얼5 - 포스트 프로세스 활용한 글리치 효과 노드(다운로드가능) 금별 04.21 73
807 언리얼4 언리얼5/후디니 - 상호작용 VFX 시스템/VAT효과 제작과정(정교한 한글자막) 금별 04.21 67
806 언리얼4 언리얼5 - 텍스처가 없는 포스트트로세스와 같은 CRT효과 제작노드(다운로드가능) 금별 04.21 55

 

Banner
 
Facebook Twitter GooglePlus KakaoStory NaverBand