Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Fur Shader ---
- fixed4 _Color;
- sampler2D _MainTex;
- half _Glossiness;
- half _Metallic;
- uniform float _FurLength;
- uniform float _Cutoff;
- uniform float _CutoffEnd;
- uniform float _EdgeFade;
- uniform fixed3 _Gravity;
- uniform fixed _GravityStrength;
- void vert (inout appdata_full v)
- {
- fixed3 direction = lerp(v.normal, _Gravity * _GravityStrength + v.normal * (1-_GravityStrength), FUR_MULTIPLIER);
- v.vertex.xyz += direction * _FurLength * FUR_MULTIPLIER * v.color.a;
- //v.vertex.xyz += v.normal * _FurLength * FUR_MULTIPLIER * v.color.a;
- }
- struct Input {
- float2 uv_MainTex;
- float3 viewDir;
- };
- void surf (Input IN, inout SurfaceOutputStandard o) {
- fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
- o.Albedo = c.rgb;
- o.Metallic = _Metallic;
- o.Smoothness = _Glossiness;
- //o.Alpha = step(_Cutoff, c.a);
- o.Alpha = step(lerp(_Cutoff,_CutoffEnd,FUR_MULTIPLIER), c.a);
- float alpha = 1 - (FUR_MULTIPLIER * FUR_MULTIPLIER);
- alpha += dot(IN.viewDir, o.Normal) - _EdgeFade;
- o.Alpha *= alpha;
- }
- SubShader {
- Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
- ZWrite On
- LOD 200
- CGPROGRAM
- #pragma surface surf Standard fullforwardshadows
- #pragma target 3.0
- fixed4 _Color;
- sampler2D _MainTex;
- half _Glossiness;
- half _Metallic;
- struct Input {
- float2 uv_MainTex;
- };
- void surf (Input IN, inout SurfaceOutputStandard o) {
- fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
- o.Albedo = c.rgb;
- o.Metallic = _Metallic;
- o.Smoothness = _Glossiness;
- o.Alpha = c.a;
- }
- ENDCG
- CGPROGRAM
- #pragma surface surf Standard fullforwardshadows alpha:blend vertex:vert
- #define FUR_MULTIPLIER 0.025
- #include "FurPass.cginc"
- ENDCG
- CGPROGRAM
- #pragma surface surf Standard fullforwardshadows alpha:blend vertex:vert
- #define FUR_MULTIPLIER 0.05
- #include "FurPass.cginc"
- ENDCG
- CGPROGRAM
- #pragma surface surf Standard fullforwardshadows alpha:blend vertex:vert
- #define FUR_MULTIPLIER 0.075
- #include "FurPass.cginc"
- ENDCG
- }
- --- Dissolve Shader ---
- struct Input {
- float2 uv_MainTex;
- };
- void surf (Input IN, inout SurfaceOutput o) {
- fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
- half dissolve = tex2D(_DissolveMap, IN.uv_MainTex).rbg - _DissolveAmount * 1.1f;
- clip(dissolve);
- if (dissolve < _BurnSize && _DissolveAmount > 0)
- {
- o.Emission = tex2D(_BurnRamp, float2(dissolve * (1 / _BurnSize), 0)) * _EmissionAmount;
- }
- o.Albedo = c.rgb;
- o.Alpha = c.a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement