✨ Add water shader by Atlas and, flip some faces and experiment with animations
This commit is contained in:
parent
bf6da1e7c9
commit
c50e9258cf
1764 changed files with 303341 additions and 66722 deletions
59
Assets/Bakery/ftFarSphere.shader
Normal file
59
Assets/Bakery/ftFarSphere.shader
Normal file
|
@ -0,0 +1,59 @@
|
|||
// Used on temporary objects captured by BakerySector
|
||||
|
||||
Shader "Hidden/ftFarSphere"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "Queue"="Geometry" }
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float3 normal : NORMAL0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float3 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float fade : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;;
|
||||
|
||||
v2f vert (appdata v, uint vertID : SV_VertexID)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = float3(v.uv, 0);
|
||||
float3 wnormal = normalize(mul((float3x3)unity_ObjectToWorld, v.normal));
|
||||
float3 wpos = mul(unity_ObjectToWorld, v.vertex);
|
||||
float3 viewDir = normalize(_WorldSpaceCameraPos - wpos);
|
||||
o.fade = saturate(dot(viewDir, wnormal));
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float4 color = tex2D(_MainTex, i.uv);
|
||||
if (color.a < 0.9) discard;
|
||||
color.rgb *= i.fade;
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue