yum-archive/SoggyShaders

Old Unity shaders.

git clone https://git.yummers.dev/yum-archive/SoggyShaders

yumAdd scaling to avatar cloning shaderad7e60e

master
2.9 KiB101 linesraw
1Shader "yum_food/avatar_clone"
2{
3  Properties
4  {
5    _BaseColor("Base color", 2D) = "white" {}
6    _Emission("Emission", 2D) = "black" {}
7    _Emission_Strength("Emission strength", float) = 0.0
8    _Normal("Normal", 2D) = "bump" {}
9    [ToggleUI] _Disable_Normal_Texture("Disable normal texture", float) = 1
10    [ToggleUI] _Disable_Normal_Recalc("Disable normal recalculation", float) = 1
11    _Metallic("Metallic", 2D) = "black" {}
12    _Roughness("Roughness", 2D) = "black" {}
13		_Cubemap("Cubemap", Cube) = "" {}
14
15    _Height("Height", 2D) = "black" {}
16    [IntRange] _Height_LOD("Height LOD", Range(0, 8)) = 8
17    _Height_Scale("Height scale", float) = 1.0
18    _Height_Exponent("Height exponent", float) = 1.0
19    _Height_Speed_X("Height speed (X axis)", float) = 0.0
20    _Height_Speed_Y("Height speed (Y axis)", float) = 0.0
21    _Height_AA_Sample_Scale("Height anti-alias UV scale", float) = 0.001
22
23    _Height_Mask("Height mask", 2D) = "white" {}
24    _Height_Mask_Exponent("Height mask exponent", float) = 1.0
25
26    _Center_Out_Speed("Center out speed", float) = 0.0
27    _Center_Out_Sharpness("Center out sharpness", float) = 4.0
28    _Center_Out_Min_Radius("Center out min radius", float) = -1.0
29    _Center_Out_Max_Radius("Center out max radius", float) = 2.7
30
31    [IntRange] _Num_Clones("Number of clones", Range(0, 4)) = 0
32    _Clone_dx("Clone dx", float) = 1.0
33    _Clone_dx_cents("Clone dx (cents)", float) = 0.0
34    _Clone_dy("Clone dy", float) = 0.0
35    _Clone_dz("Clone dz", float) = 0.0
36    _Clone_Scale("Clone scale", float) = 1.0
37    [ToggleUI] _Clone_Enable_Av_Height_Fix("Clone avatar height fix", float) = 0.0
38    _Clone_Av_Height_Fix("Clone avatar height fix", float) = 0.0
39    [ToggleUI] _Clone_Enable_Rotation("Enable clone rotation", float) = 0.0
40  }
41  SubShader
42  {
43    Pass {
44      Tags {
45        "RenderType"="Opaque"
46        "Queue"="AlphaTest+499"
47        "LightMode" = "ForwardBase"
48      }
49      Blend SrcAlpha OneMinusSrcAlpha
50      ZWrite On
51      ZTest LEqual
52      Cull Back
53
54      CGPROGRAM
55      #pragma target 5.0
56
57      #pragma multi_compile _ VERTEXLIGHT_ON
58
59      #pragma vertex vert
60      #pragma geometry geom
61      #pragma fragment frag
62
63      #define FORWARD_BASE_PASS
64
65      // Three anti-aliasing levels.
66      // 0: no anti-aliasing
67      // 1: sample 4 neighbors (diagonals)
68      // 2: sample 8 neighbors (diagonals + cartesian)
69      #define HEIGHT_AA_LEVEL 2
70
71      #include "avatar_clone_lighting.cginc"
72      ENDCG
73    }
74    Pass {
75      Tags {
76        "RenderType" = "Opaque"
77        "LightMode" = "ForwardAdd"
78        "Queue"="AlphaTest+499"
79      }
80      Blend One One
81      ZWrite On
82      ZTest LEqual
83      Cull Back
84
85      CGPROGRAM
86      #pragma target 5.0
87
88      #pragma multi_compile_fwdadd
89
90      #pragma vertex vert
91      #pragma geometry geom
92      #pragma fragment frag
93
94      #define HEIGHT_AA_LEVEL 2
95
96      #include "avatar_clone_lighting.cginc"
97      ENDCG
98    }
99  }
100}
101