[URP] Fire Shader Graph
Unity3D/Shader 2021. 10. 26. 01:41Surface Shader
Shader "ShaderStudy/Part06/Fire"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_MainTex2 ("Albedo (RGB)", 2D) = "black" {}
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent"}
LOD 200
CGPROGRAM
#pragma surface surf Standard alpha:fade
sampler2D _MainTex;
sampler2D _MainTex2;
struct Input
{
float2 uv_MainTex;
float2 uv_MainTex2;
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
fixed4 d = tex2D (_MainTex2, float2(IN.uv_MainTex2.x, IN.uv_MainTex2.y - _Time.y));
fixed4 c = tex2D (_MainTex, IN.uv_MainTex + d.r- 0.1);
o.Emission = c.rgb-0.1;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Shader Graph
참고
https://chulin28ho.tistory.com/671
https://docs.unity3d.com/Packages/com.unity.shadergraph@10.2/manual/Sample-Texture-2D-Node.html
https://developer.download.nvidia.com/cg/tex2D.html
https://www.youtube.com/watch?v=FIvovRrxGUQ
https://darkcatgame.tistory.com/9
https://github.com/jwawon/UnityShaderStartupStudy/blob/master/Assets/Shaders/Part06/Fire.shader
'Unity3D > Shader' 카테고리의 다른 글
Shader warning in ... CGIncludes/UnityMetaPass.cginc(295) (on d3d11) (0) | 2021.11.18 |
---|---|
TRANSFORM_TEX (0) | 2021.11.17 |
[URP] Gray-scale Shader Graph (0) | 2021.10.26 |
[URP] Lerp Shader Graph (0) | 2021.10.26 |
인스펙터에 R, G, B 컬러 프로퍼티 만들고 출력하기 (0) | 2021.10.25 |