Add MEGA Ocean Liner, split decks, and detailed ship materials
This commit is contained in:
@@ -9,6 +9,7 @@ Shader "BigShipTycoon/Service Deck Surface"
|
||||
_BayLength ("Compartment length", Float) = 6
|
||||
_RoomLight ("Compartment fixture offset", Float) = 4
|
||||
_DeckTread ("Deck surface", Float) = 0
|
||||
_BulkheadLining ("Bulkhead panel joints", Float) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
@@ -16,12 +17,14 @@ Shader "BigShipTycoon/Service Deck Surface"
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
#include "TycoonTexturing.cginc"
|
||||
|
||||
fixed4 _Color;
|
||||
float _Roughness, _Metal, _Emissive, _BayLength, _RoomLight, _DeckTread;
|
||||
float _Roughness, _Metal, _Emissive, _BayLength, _RoomLight, _DeckTread, _BulkheadLining;
|
||||
struct Input { float4 vertex : POSITION; float3 normal : NORMAL; };
|
||||
struct Output { float4 clip : SV_POSITION; float3 local : TEXCOORD0; float3 normal : TEXCOORD1; };
|
||||
|
||||
@@ -58,17 +61,36 @@ Shader "BigShipTycoon/Service Deck Surface"
|
||||
corridor *= 1 - .62 * smoothstep(1.10, 2.25, abs(p.z));
|
||||
work *= smoothstep(.35, 1.88, abs(p.z));
|
||||
float fill = lerp(.72, 1, saturate(p.y * .72));
|
||||
float grain = p.x * 112 + p.y * 91;
|
||||
float matte = .98 + .018 * (1 - smoothstep(.5, 2.4, fwidth(grain))) * sin(grain) * sin(p.z * 87 - p.y * 30);
|
||||
float2 treadCoord = p.xz / .145;
|
||||
float2 cell = abs(frac(treadCoord) - .5);
|
||||
float relief = 1 - smoothstep(.30, .46, cell.x + cell.y);
|
||||
float detail = 1 - smoothstep(.45, 1.3, fwidth(treadCoord.x) + fwidth(treadCoord.y));
|
||||
matte += .086 * relief * detail * _DeckTread * saturate(normal.y);
|
||||
float2 gauge = TycoonPlane(p, normal);
|
||||
float matte = .995 + TycoonStipple(gauge, 93) * .061;
|
||||
if (_Metal > .5)
|
||||
matte += TycoonGrain(gauge, 41) * .067;
|
||||
if (_BulkheadLining > .5)
|
||||
{
|
||||
float plate;
|
||||
float seam = TycoonPanel(gauge, float2(1, .55), .5, .0038, plate);
|
||||
matte += plate * .085 - seam * .26;
|
||||
}
|
||||
if (_DeckTread > .5)
|
||||
{
|
||||
float up = saturate(normal.y);
|
||||
float2 grain = p.xz * float2(10.8, 16.4);
|
||||
float row = floor(grain.y);
|
||||
float2 stamp = abs(frac(grain + float2(frac(row * .5), 0)) - .5);
|
||||
float bolt = (1 - smoothstep(.28, .43, stamp.x + stamp.y * .82)) * TycoonDetail2(grain);
|
||||
float deckPlate;
|
||||
float joints = TycoonPanel(p.xz, float2(.52, .83), .5, .006, deckPlate);
|
||||
matte += up * (bolt * .16 + deckPlate * .067 - joints * .21);
|
||||
if (_DeckTread > 1.5)
|
||||
{
|
||||
float grids = max(TycoonJoint(p.x * 8.1, .068), TycoonJoint(p.z * 15.7, .082));
|
||||
matte = lerp(matte, .68 + grids * .42, TycoonDetail2(p.xz * 9.5) * up * .83);
|
||||
}
|
||||
}
|
||||
float3 diffuse = _Color.rgb * (float3(.34, .40, .42) * fill + corridor + work) * matte;
|
||||
float fresnel = pow(1 - saturate(dot(viewDirection, normal)), 3);
|
||||
float3 bounce = float3(.14, .20, .23) * fresnel * (.20 + _Metal * .40);
|
||||
return fixed4(saturate(diffuse + bounce + _Color.rgb * _Emissive * .66), 1);
|
||||
return fixed4(TycoonHighlightRollOff(diffuse + bounce + _Color.rgb * _Emissive * .66), 1);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user