Add MEGA Ocean Liner, split decks, and detailed ship materials
This commit is contained in:
@@ -14,13 +14,15 @@ Shader "BigShipTycoon/Bridge Glazing"
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
#include "TycoonTexturing.cginc"
|
||||
|
||||
fixed4 _Color;
|
||||
struct Input { float4 vertex : POSITION; float3 normal : NORMAL; };
|
||||
struct Output { float4 clip : SV_POSITION; float3 world : TEXCOORD0; float3 normal : TEXCOORD1; };
|
||||
struct Output { float4 clip : SV_POSITION; float3 world : TEXCOORD0; float3 normal : TEXCOORD1; float3 local : TEXCOORD2; };
|
||||
|
||||
Output vert(Input input)
|
||||
{
|
||||
@@ -28,6 +30,7 @@ Shader "BigShipTycoon/Bridge Glazing"
|
||||
output.clip = UnityObjectToClipPos(input.vertex);
|
||||
output.world = mul(unity_ObjectToWorld, input.vertex).xyz;
|
||||
output.normal = UnityObjectToWorldNormal(input.normal);
|
||||
output.local = input.vertex.xyz;
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -35,10 +38,17 @@ Shader "BigShipTycoon/Bridge Glazing"
|
||||
{
|
||||
float3 eye = normalize(_WorldSpaceCameraPos.xyz - input.world);
|
||||
float3 normal = normalize(input.normal);
|
||||
float edge = pow(1 - abs(dot(eye, normal)), 2);
|
||||
float reflection = pow(saturate(reflect(-eye, normal).y), 4);
|
||||
float3 tint = lerp(_Color.rgb * .64, float3(.89,.82,.66), reflection * .36);
|
||||
return fixed4(tint, .041 + edge * .21 + reflection * .058);
|
||||
float edge = 1 - abs(dot(eye, normal));
|
||||
float3 reflection = reflect(-eye, normal);
|
||||
float reflectedSky = smoothstep(.03, .79, reflection.y);
|
||||
float horizon = 1 - smoothstep(.024, .21, abs(reflection.y - .055));
|
||||
float wash = sin(input.local.x * .51 + input.local.z * .84) * sin(input.local.y * 2.43)
|
||||
* TycoonDetail(input.local.y * .386);
|
||||
float glare = pow(saturate(dot(reflection, float3(-.69,.46,-.43))), 21);
|
||||
float3 tint = lerp(_Color.rgb * .63, float3(.74,.83,.86), reflectedSky * .46);
|
||||
tint += horizon * float3(.073,.092,.106) + glare * float3(.08,.068,.051);
|
||||
float alpha = .044 + edge * edge * .20 + reflectedSky * .041 + wash * .007;
|
||||
return fixed4(tint, alpha);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user