Add MEGA Ocean Liner, split decks, and detailed ship materials

This commit is contained in:
josh
2026-11-28 21:02:42 -05:00
parent ce0d38c8de
commit 46624bf5ba
47 changed files with 2042 additions and 382 deletions

View File

@@ -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
}

View File

@@ -23,6 +23,7 @@ Shader "BigShipTycoon/Harbor Surface"
#pragma fragment frag
#include "UnityCG.cginc"
#include "OceanWaves.cginc"
#include "TycoonTexturing.cginc"
fixed4 _Color;
float _Roughness, _Metal, _Emissive, _Weather, _Finish, _Waterline;
@@ -51,89 +52,82 @@ Shader "BigShipTycoon/Harbor Surface"
return output;
}
float PanelShade(float2 cell)
float SurfaceTone(float3 local, float3 localNormal)
{
float3 p = frac(cell.xyx * .1031);
p += dot(p, p.yzx + 33.33);
return frac((p.x + p.y) * p.z);
}
float2 uv = TycoonPlane(local, localNormal);
float upward = abs(localNormal.y);
float weather = sin(uv.x * .91 + uv.y * 1.79) * sin(uv.y * 4.23 - uv.x * .47);
float tone = 1 + weather * _Weather * .057;
// Fade details whose period falls beneath a pixel, especially around the railings.
float Detail(float phase)
{
return 1 - smoothstep(.25, .86, fwidth(phase));
}
float Groove(float phase, float width)
{
float edge = abs(frac(phase + .5) - .5);
float feather = max(.002, fwidth(phase) * .56);
return (1 - smoothstep(width, width + feather, edge)) * Detail(phase);
}
float SurfaceTone(float3 p, float3 normal)
{
float paint = sin(p.x * .82 + p.z * 1.7) * sin(p.y * 3.5 + p.z * 4.8);
float tone = 1 + paint * _Weather * .16;
if (_Finish == 1)
{
float horizontal = step(.6, abs(normal.y));
float crossGrain = lerp(p.y, p.z, horizontal);
float across = crossGrain / .215;
float row = floor(across);
float along = p.x * .383 + row * .381966;
float plank = PanelShade(float2(floor(along), row)) - .5;
float fibre = crossGrain * 53 + .73 * sin(p.x * 2.8 + crossGrain * 32);
float grain = sin(fibre) * Detail(crossGrain * 8.4);
float seams = Groove(across, .014) + Groove(p.x * .383 + frac(row * .381966), .0026);
float wear = sin(p.x * 2.2 + crossGrain * 2.9) * cos(crossGrain * 8.2 - p.x * 1.9);
tone = 1 + plank * .19 * Detail(across) + grain * .055 - seams * lerp(.12, .27, horizontal)
+ wear * .036 * _Weather;
float board;
float caulk = TycoonPanel(uv, float2(.406, 6.1), .376, .0025, board);
float fibre = TycoonGrain(uv, 11);
float lowGrain = sin(uv.y * 26 + sin(uv.x * 1.16) * 2.6) * TycoonDetail(uv.y * 4.15);
tone += board * .26 + fibre * .049 + lowGrain * .055
- caulk * lerp(.17, .35, upward) + TycoonStipple(uv, 83) * .045;
}
else if (_Finish == 3)
{
float crossFibre = abs(normal.y) > .55 ? p.z : p.y;
float weave = cos(p.x * 142) * cos(crossFibre * 153) * Detail(crossFibre * 24.4) * Detail(p.x * 22.6);
float mottling = sin(p.x * 11 + crossFibre * 16) * sin(p.x * 23 - crossFibre * 13);
tone = 1 + .037 * weave + .028 * mottling * Detail(p.x * 3.7);
float weave = TycoonWeave(uv, float2(23, 29));
float nap = TycoonStipple(uv + float2(uv.y * .24, 0), 87) * .080;
tone += weave * .061 + nap;
if (_FabricMotif > .01)
{
float2 diamonds = float2(p.x + crossFibre, p.x - crossFibre) * 1.83;
float braid = Groove(diamonds.x, .065) * .046 + Groove(diamonds.y, .065) * .046;
float inset = Groove(diamonds.x + .5, .08) * Groove(diamonds.y + .5, .08) * .19;
tone += (braid + inset - .026) * _FabricMotif;
float2 diamonds = float2(uv.x + uv.y, uv.x - uv.y) * 1.83;
float border = TycoonJoint(diamonds.x, .056) + TycoonJoint(diamonds.y, .056);
float rosette = TycoonJoint(diamonds.x + .5, .13) * TycoonJoint(diamonds.y + .5, .13);
tone += (border * .084 + rosette * (.125 + .075 * weave) - .028) * _FabricMotif;
}
}
else if (_Finish == 4)
{
float brush = abs(normal.y) > .55 ? p.z : p.y;
float scratches = sin(brush * 82 + sin(p.x * 1.25)) * Detail(brush * 13);
tone = 1 + scratches * .04 + paint * .025;
float mill = uv.y * 79 + sin(uv.x * 1.25) * .20;
float satin = cos(mill * 6.283185) * TycoonDetail(uv.y * 79);
float polishing = TycoonGrain(uv, 13.2) * .034;
tone += satin * .058 + polishing + weather * .019;
}
else if (_Finish == 5)
else if (_Finish == 5 || _Finish == 9)
{
float along = p.x + p.z * .42;
float plateRow = floor(p.y * .86);
float plateAlong = along * .23 + plateRow * .5;
float irregular = PanelShade(float2(floor(plateAlong), plateRow)) - .5;
float runoff = sin(along * 9.1 + sin(along * 2.1)) * sin(along * 2.9 - .2 * p.y);
float plates = Groove(p.y * .86, .008) + Groove(plateAlong, .005);
float salt = 1 - smoothstep(-.04, .82, p.y);
tone = 1 + salt * .15
+ (irregular * .25 + paint * .1 + runoff * .21 * Detail(along * 1.45) - plates * .21) * _Weather;
float plate;
float strength = _Finish == 5 ? 1 : .45;
float above = 1 - smoothstep(.18, 1.74, local.y);
float joints = TycoonPanel(uv, float2(.193, .844), .5, .008, plate);
float runoff = sin(uv.x * 9.1 + sin(uv.x * 2.1)) * sin(uv.x * 2.9 - .2 * uv.y);
tone += (plate * .092 - joints * .21) * strength * (1 - upward * .80)
+ (.14 * above + runoff * .093 * TycoonDetail(uv.x * 1.45)) * _Weather
+ TycoonStipple(uv, 67) * .035;
}
else if (_Finish == 7)
{
float vein = max(TycoonVein(uv), TycoonVein(uv * .46 + float2(.45,.17)) * .78);
float stone;
float joints = TycoonPanel(uv, float2(1.31, 1.31), .5, .0035, stone);
tone += stone * .060 - vein * .096 - joints * .17 + TycoonStipple(uv, 94) * .033;
}
else if (_Finish == 8 || _Finish == 10)
{
float grass = _Finish == 8 ? 1 : 0;
float mowing = sin(uv.y * 3.7 + .25 * sin(uv.x * .63)) * TycoonDetail(uv.y * .59);
float aggregate = TycoonStipple(uv, 53) * .28 + TycoonStipple(uv, 130) * .13;
tone += aggregate + grass * (.075 * mowing + .058 * weather);
}
else if (_Finish != 2 && _Finish != 11)
{
// Orange-peel paint remains nearly solid on rails and thin moldings.
tone += TycoonStipple(uv, 118) * (.038 + _Weather * .025);
}
if (_TileFrequency > 0)
{
float3 axis = abs(normal);
float2 face = axis.y > .57 ? p.xz : axis.x > axis.z ? p.zy : p.xy;
float2 grout = face * _TileFrequency;
float tileVariation = (PanelShade(floor(grout)) - .5) * Detail(grout.x) * Detail(grout.y);
tone *= 1 + tileVariation * .18 - max(Groove(grout.x, .036), Groove(grout.y, .036)) * .31;
float ceramic;
float grout = TycoonPanel(uv, float2(_TileFrequency, _TileFrequency), 0, min(.009, .044 / _TileFrequency), ceramic);
tone *= 1 + ceramic * .23 - grout * .37;
}
return tone;
}
float3 PoolColor(float3 world, float4 basin, float3 normal, float3 eye, float3 sky, float glint, float fresnel)
float3 PoolColor(float4 basin, float3 normal, float3 eye, float3 sky, float glint, float fresnel)
{
// Unmapped water is used for small fountains. Pool caps carry distance to their own basin edges.
if (basin.z < .01)
@@ -141,14 +135,17 @@ Shader "BigShipTycoon/Harbor Surface"
float edge = min(basin.z - abs(basin.x), basin.w - abs(basin.y));
float shallow = 1 - smoothstep(.015, .86, edge);
float bottomShade = lerp(.73, 1, smoothstep(-.01, .14, edge));
float2 p = world.xz;
float2 p = basin.xy;
float time = _Time.y;
float2 wave = float2(p.x * 2.29 + p.y * 1.88, p.y * 2.63 - p.x * 1.03);
wave.x += .17 * sin(p.y * 6.3 - time * 1.7) + time * .22;
wave.y += .13 * sin(p.x * 5.04 + time * 1.52) - time * .31;
float distance = min(abs(frac(wave.x) - .5), abs(frac(wave.y) - .5));
float feather = max(max(fwidth(wave.x), fwidth(wave.y)) * .69, .029);
float caustic = (1 - smoothstep(.021, .027 + feather, distance)) * Detail(wave.x) * Detail(wave.y);
float caustic = (1 - smoothstep(.021, .027 + feather, distance)) * TycoonDetail(wave.x) * TycoonDetail(wave.y);
float tile;
float grout = TycoonPanel(p, float2(12.5, 12.5), 0, .0035, tile);
bottomShade *= 1 + tile * .05 - .11 * grout;
float3 body = _Color.rgb * lerp(float3(.52,.68,.83), float3(1.14,1.39,1.37), shallow);
float3 teal = body * bottomShade + caustic * float3(.07,.15,.13) * lerp(.45, 1, shallow);
float waterFresnel = .06 + pow(1 - saturate(dot(eye, normal)), 5) * .54;
@@ -160,11 +157,11 @@ Shader "BigShipTycoon/Harbor Surface"
float3 normal = normalize(input.normal);
if (_Finish == 6)
{
float2 p = input.world.xz;
float2 p = input.local.xz;
float rippleX = p.x * 5.7 + p.y * 2.2 - _Time.y * 2.7;
float rippleZ = p.y * 8.3 - p.x * 1.3 + _Time.y * 3.1;
float3 ripple = float3(sin(rippleX) * Detail(p.x * .91), 0, sin(rippleZ) * Detail(p.y * 1.32));
normal = normalize(normal + ripple * .095);
float3 ripple = float3(sin(rippleX) * TycoonDetail(p.x * .91), 0, sin(rippleZ) * TycoonDetail(p.y * 1.32));
normal = normalize(normal + mul((float3x3)unity_ObjectToWorld, ripple) * .095);
}
float3 eye = unity_OrthoParams.w > .5 ? UNITY_MATRIX_V[2].xyz
: normalize(_WorldSpaceCameraPos.xyz - input.world);
@@ -180,7 +177,7 @@ Shader "BigShipTycoon/Harbor Surface"
float3 skyReflection = lerp(float3(.11,.19,.27), float3(.39,.48,.60), saturate(reflected.y))
+ sunsetStripe * float3(.20,.12,.061);
if (_Finish == 6)
return fixed4(saturate(PoolColor(input.world, input.basin, normal, eye, skyReflection, specular, fresnel)), 1);
return fixed4(saturate(PoolColor(input.basin, normal, eye, skyReflection, specular, fresnel)), 1);
float overcast = _TycoonSeaWeather * _TycoonSeaSailing;
float3 direct = lerp(float3(.58,.46,.34), float3(.20,.24,.28), overcast);
float3 light = lerp(float3(.26,.34,.43), float3(.62,.69,.75), sky) + sunlight * direct;
@@ -195,7 +192,7 @@ Shader "BigShipTycoon/Harbor Surface"
diffuse *= lerp(.60, 1, smoothstep(0, .64, aboveWater));
diffuse += skyReflection * (.12 * (1 - smoothstep(.04,.67,aboveWater)) * (.26 + fresnel * .62));
}
if (_Finish == 2)
if (_Finish == 2 || _Finish == 11)
{
float horizon = 1 - smoothstep(.005, .067 + _Roughness * .12, abs(reflected.y - .025));
float roofReflection = smoothstep(.21, .28, reflected.y) * (1 - smoothstep(.31, .44, reflected.y));
@@ -203,11 +200,19 @@ Shader "BigShipTycoon/Harbor Surface"
+ float3(.18,.23,.25) * roofReflection * .12;
float facing = smoothstep(-.12, .49, reflected.y);
float3 glass = diffuse * (.47 + facing * .30) + glazing + specular * float3(.65,.55,.41) * .33;
return fixed4(saturate(lerp(glass, diffuse + glazing * .32 + _Color.rgb * .22, _Emissive)), 1);
if (_Finish == 11)
{
float2 uv = TycoonPlane(input.local, normalize(input.localNormal));
float2 centers = uv * 8.5 + float2(frac(floor(uv.y * 8.5) * .5), 0);
float2 cell = frac(centers) - .5;
float coverage = (1 - smoothstep(.022, .069, dot(cell, cell))) * TycoonDetail2(uv * 8.5);
glass = lerp(glass, float3(.54,.68,.71) + glazing * .32, coverage * .58);
}
return fixed4(TycoonHighlightRollOff(lerp(glass, diffuse + glazing * .32 + _Color.rgb * .22, _Emissive)), 1);
}
float3 shine = skyReflection * (.045 + fresnel * .21 + _Metal * .16) * (1 - _Roughness * .56)
+ specular * float3(.73,.60,.43) * (.10 + .47 * _Metal) * saturate(3 * sunlight);
return fixed4(saturate(diffuse + shine + _Color.rgb * _Emissive * .53), 1);
return fixed4(TycoonHighlightRollOff(diffuse + shine + _Color.rgb * _Emissive * .53), 1);
}
ENDCG
}

View File

@@ -166,6 +166,21 @@
.action.voyage-control-active { background-color: #d8b680; border-color: #e8c992; color: #1b302f; }
.voyage-deck-stack .action.voyage-view-button { height: 26px; min-height: 26px; margin: 0 0 2px; }
.voyage-deck-stack #passage-deck-all { margin-bottom: 6px; }
.voyage-deck-stack.voyage-deck-stack-mega { width: 155px; }
.voyage-deck-zone-row, .voyage-deck-grid {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
.voyage-deck-zone-row { margin-bottom: 4px; }
.voyage-deck-zone-row .action.voyage-view-button, .voyage-deck-grid .action.voyage-view-button {
width: 49%;
min-width: 0;
flex-shrink: 0;
padding: 0;
font-size: 11px;
}
.voyage-event-host.voyage-event-host-mega { right: 194px; }
.action.voyage-reset { margin-left: 7px; }
.voyage-rail {
min-height: 70px;

View File

@@ -10,6 +10,7 @@ Shader "BigShipTycoon/Passenger Surface"
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TycoonTexturing.cginc"
struct Input
{
@@ -61,10 +62,14 @@ Shader "BigShipTycoon/Passenger Surface"
float glint = pow(saturate(dot(normal, normalize(lightDirection + eye))), lerp(47, 12, skin * .72 + fabric * .12));
float luminousEdge = fresnel * (.023 + .013 * skin);
float3 sheen = glint * lerp(float3(.112,.131,.145), float3(.102,.068,.055), skin) * (.37 + .64 * sun);
float2 stitch = input.body.xy * float2(185, 201) + input.body.z * float2(94, -117);
float2 filter = 1 - smoothstep(.24, .90, fwidth(stitch) * .159);
float weave = 1 + .032 * fabric * filter.x * filter.y * (sin(stitch.x) * cos(stitch.y));
return fixed4(saturate(input.tint.rgb * light * weave + sheen + float3(.57,.69,.76) * luminousEdge), 1);
float2 cloth = input.body.xy + input.body.z * float2(.41, -.37);
float knit = TycoonWeave(cloth, float2(42, 51));
float narrowStripe = cos(cloth.y * 137 + cloth.x * 21) * TycoonDetail(cloth.y * 21.8);
float fabricTone = fabric * (knit * .097 + narrowStripe * .024);
float pores = TycoonStipple(cloth, 122) * skin * .058;
float3 color = input.tint.rgb * light * (1 + fabricTone + pores) + sheen
+ float3(.57,.69,.76) * luminousEdge;
return fixed4(TycoonHighlightRollOff(color), 1);
}
ENDCG
}

View File

@@ -18,6 +18,7 @@ Shader "BigShipTycoon/Port Scenery Surface"
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "TycoonTexturing.cginc"
float4 _Color, _HazeColor;
float _Detail, _Glow;
@@ -33,20 +34,13 @@ Shader "BigShipTycoon/Port Scenery Surface"
return output;
}
float Lattice(float2 cell)
{
float3 p = frac(cell.xyx * .1031);
p += dot(p, p.yzx + 33.33);
return frac((p.x + p.y) * p.z);
}
float GroundNoise(float2 position)
{
float2 cell = floor(position);
float2 blend = frac(position);
blend *= blend * (3 - 2 * blend);
return lerp(lerp(Lattice(cell), Lattice(cell + float2(1,0)), blend.x),
lerp(Lattice(cell + float2(0,1)), Lattice(cell + 1), blend.x), blend.y);
return lerp(lerp(TycoonCell(cell), TycoonCell(cell + float2(1,0)), blend.x),
lerp(TycoonCell(cell + float2(0,1)), TycoonCell(cell + 1), blend.x), blend.y);
}
fixed4 frag(Output input, fixed side : VFACE) : SV_Target
@@ -55,24 +49,36 @@ Shader "BigShipTycoon/Port Scenery Surface"
float3 n = normalize(input.normal) * (side >= 0 ? 1 : -1);
float3 view = normalize(_WorldSpaceCameraPos.xyz - p);
float3 sun = normalize(float3(-.69,.40,-.43));
float2 face = TycoonPlane(p, n);
float2 samplePosition = p.xz + p.y * float2(.42,.76);
float relief = GroundNoise(samplePosition * .22) - .5;
float fine = (GroundNoise(samplePosition * 1.35) - .5) * (1 - smoothstep(.35,.91, length(fwidth(samplePosition))));
float fine = (GroundNoise(face * 1.25) - .5) * TycoonDetail2(face * 1.25);
float coarse = GroundNoise(samplePosition * .071) - .5;
float3 albedo = _Color.rgb * (1 + relief * .10 + fine * .075);
if (_Detail == 1)
{
float stone = smoothstep(-.23,.29, .55 * relief + .24 * fine + .42 * coarse);
albedo *= .79 + .30 * stone + coarse * .19;
albedo *= .79 + .30 * stone + coarse * .19 + TycoonStipple(face, 6.8) * .13;
albedo *= lerp(.72, 1, smoothstep(-.12, 1.4, p.y));
}
if (_Detail == 2)
else if (_Detail == 2)
{
float tile = 1 - smoothstep(.024,.094, abs(frac((p.z + p.y * .56) * 1.9 + .5) - .5));
albedo *= 1 + fine * .11 - tile * .10 * (1 - smoothstep(.28, .68, fwidth(p.z * 1.9)));
float tileShade;
float joint = TycoonPanel(face, float2(3.5, 5.2), .5, .016, tileShade);
albedo *= 1 + fine * .10 + tileShade * .22 - joint * .27;
}
if (_Detail == 4)
albedo *= .87 + relief * .16 + fine * .12 + coarse * .13;
else if (_Detail == 4)
albedo *= .87 + relief * .16 + fine * .12 + coarse * .13 + TycoonStipple(face, 7.1) * .115;
else if (_Detail == 5)
{
float board;
float seam = TycoonPanel(face, float2(.40, 5.8), .39, .0032, board);
albedo *= 1 + board * .21 + TycoonGrain(face, 11) * .055 - seam * .27;
}
else if (_Detail == 6)
albedo *= 1 + TycoonStipple(face, 18) * .17 + TycoonStipple(face, 7.8) * .070;
else if (_Detail == 7)
albedo *= 1 + TycoonGrain(face, 33) * .105;
float diffuse = saturate(dot(n, sun));
float sky = n.y * .5 + .5;
@@ -87,7 +93,7 @@ Shader "BigShipTycoon/Port Scenery Surface"
}
float distance = length(_WorldSpaceCameraPos.xyz - p);
float haze = smoothstep(120, 640, distance) * .87;
return fixed4(lerp(color, _HazeColor.rgb, haze), 1);
return fixed4(TycoonHighlightRollOff(lerp(color, _HazeColor.rgb, haze)), 1);
}
ENDCG
}

View File

@@ -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
}

View File

@@ -143,6 +143,7 @@
.work-berth.work-room-20 { background-color: #69503b; border-color: #c19762; }
.work-berth.work-room-21 { background-color: #455e4c; border-color: #92b192; }
.work-berth.work-room-22 { background-color: #26586c; border-color: #72b5ca; }
.work-mega .work-berth { margin: 1px; }
.work-berth.work-berth-join-left { margin-left: 0; border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.work-berth.work-berth-join-right { margin-right: 0; border-right-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.work-berth.work-berth-join-top { margin-top: 0; border-top-width: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
@@ -298,3 +299,38 @@
.work-fit-modes .work-selected { border-color: #caad74; color: #f0d3a7; background-color: #30494b; }
.work-fit-modes .work-tool-rotate { margin-left: auto; color: #f0d3a7; border-color: #917d55; }
.work-tool-orientation { align-self: center; color: #b4d2cb; font-size: 11px; margin-right: 5px; }
.work-mega .ship-work-heading { font-size: 36px; white-space: normal; }
.work-mega .work-deck-controls { width: 67%; max-width: 760px; min-width: 0; }
.work-mega .work-deck-selector { flex: 1 1 0; min-width: 0; flex-direction: column; }
.work-deck-band { flex-direction: row; }
.work-mega .work-deck-tab {
width: 12.5%;
min-width: 0;
flex-shrink: 0;
height: 30px;
min-height: 30px;
padding: 0;
font-size: 12px;
}
.work-deck-band-lower { border-top-width: 1px; border-top-color: #345b60; }
.work-mega .work-deck-add { flex-shrink: 0; margin-left: 7px; padding: 0 9px; font-size: 12px; }
.work-mega .work-berth-grid { left: 12%; right: 17%; top: 24%; bottom: 24%; }
.work-mega .work-berth-index { top: 3px; left: 4px; }
.work-mega .work-berth-name { font-size: 9px; }
.work-mega .work-berth .work-facility-icon,
.work-mega .work-span-caption .work-facility-icon { width: 18px; height: 18px; }
.work-mega .work-capacity-strip, .work-mega .work-fit-modes { flex-wrap: wrap; }
.work-mega .work-tool { padding: 3px 6px; margin: 0 2px; }
.work-mega .work-tool .work-facility-icon { margin-right: 5px; width: 22px; height: 22px; }
.work-mega .work-tool-copy { flex: 1 1 0; }
.work-mega .work-tool-name { font-size: 12px; white-space: normal; }
.work-mega .work-tool-cost { font-size: 10px; white-space: normal; }
.work-offer.work-offer-mega { padding: 4px 8px; }
.work-offer.work-offer-mega .work-offer-name { font-size: 14px; white-space: normal; }
.yard-work-mega .ship-work-heading { font-size: 36px; white-space: normal; }
.yard-work-mega .work-purchase,
.yard-work-mega .work-contract { flex: 1 1 0; min-width: 0; }
.yard-work-mega .work-name-control { flex-shrink: 0; }
.yard-work-mega .work-contract-block { white-space: normal; }

View File

@@ -113,3 +113,5 @@
border-color: #dd9a7e;
background-color: rgba(159, 71, 56, .29);
}
.sun-terrace-diagram { left: 19%; right: 19%; background-color: #122d35; border-color: #79a8a4; border-width: 2px; border-radius: 18px; }

View File

@@ -0,0 +1,88 @@
#ifndef TYCOON_TEXTURING
#define TYCOON_TEXTURING
float TycoonCell(float2 cell)
{
float3 p = frac(cell.xyx * .1031);
p += dot(p, p.yzx + 33.33);
return frac((p.x + p.y) * p.z);
}
float TycoonDetail(float phase)
{
return 1 - smoothstep(.24, .82, fwidth(phase));
}
float TycoonDetail2(float2 phase)
{
float2 spread = fwidth(phase);
return 1 - smoothstep(.22, .75, max(spread.x, spread.y));
}
float TycoonJoint(float phase, float halfWidth)
{
float pixel = max(.0002, fwidth(phase));
float distance = abs(frac(phase + .5) - .5);
float core = max(0, halfWidth - pixel * .42);
float shoulder = halfWidth + pixel * .58;
float coverage = saturate((2 * halfWidth + .003) / pixel);
return (1 - smoothstep(core, shoulder, distance)) * coverage * (1 - smoothstep(.23, .77, pixel));
}
float2 TycoonPlane(float3 p, float3 normal)
{
float3 axis = abs(normal);
if (axis.y >= max(axis.x, axis.z))
return p.xz;
return axis.z >= axis.x ? p.xy : p.zy;
}
// Offset narrow strips by row to break straight cross joints without introducing mip shimmer.
float TycoonPanel(float2 uv, float2 piecesPerMeter, float stagger, float jointWidth, out float variation)
{
float2 cell = uv * piecesPerMeter;
float row = floor(cell.y);
float x = cell.x + frac(row * stagger);
variation = (TycoonCell(float2(floor(x), row)) - .5) * TycoonDetail2(cell);
return max(TycoonJoint(x, jointWidth * piecesPerMeter.x), TycoonJoint(cell.y, jointWidth * piecesPerMeter.y));
}
float TycoonWeave(float2 uv, float2 threadsPerMeter)
{
float2 thread = uv * threadsPerMeter;
float2 fibre = cos(thread * 6.283185);
return (fibre.x * .39 + fibre.y * .37 + fibre.x * fibre.y * .24) * TycoonDetail2(thread);
}
float TycoonGrain(float2 uv, float frequency)
{
float ribbon = uv.y * frequency + sin(uv.x * 2.78 + uv.y * 27.1) * .14
+ sin(uv.x * .92 - uv.y * 12.7) * .15;
float main = sin(ribbon * 6.283185) * TycoonDetail(uv.y * frequency);
float fine = sin((ribbon * 2.17 - uv.x * .13) * 6.283185) * TycoonDetail(uv.y * frequency * 2.17);
return main * .71 + fine * .29;
}
float TycoonVein(float2 uv)
{
float phase = uv.x * .92 + uv.y * .62 + sin(uv.y * 2.39) * .28
+ sin(uv.x * 5.4 - uv.y * 2.7) * .071;
float quartz = TycoonJoint(phase, .037);
float fine = TycoonJoint(phase * 2.69 + .263 + .12 * sin(uv.y * 9), .016);
return quartz * .71 + fine * .29;
}
float TycoonStipple(float2 uv, float grainsPerMeter)
{
float2 grit = uv * grainsPerMeter;
return (TycoonCell(floor(grit)) - .5) * TycoonDetail2(grit);
}
float3 TycoonHighlightRollOff(float3 color)
{
// Preserve detail on white enamel, limestone, and polished edges before the framebuffer clips.
float3 excess = max(0, color - .79);
return saturate(min(color, .79) + excess / (1 + excess * 4.76));
}
#endif

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 67891790c57f48f18ccdbd5a4cbc34b9
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: