Animate passenger venues and add port-specific cinematics

This commit is contained in:
josh
2026-11-28 14:57:34 -05:00
parent 384f140b92
commit 636a0e2cf8
37 changed files with 2891 additions and 355 deletions

View File

@@ -6,33 +6,65 @@ Shader "Soundings/Passenger Surface"
Pass
{
CGPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct Input { float4 vertex : POSITION; float3 normal : NORMAL; fixed4 tint : COLOR; };
struct Output { float4 clip : SV_POSITION; float3 normal : TEXCOORD0; fixed4 tint : COLOR; };
struct Input
{
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 tint : COLOR;
float4 body : TEXCOORD0;
};
struct Output
{
float4 clip : SV_POSITION;
float3 normal : TEXCOORD0;
float3 world : TEXCOORD1;
float4 body : TEXCOORD2;
fixed4 tint : COLOR;
};
Output vert(Input input)
{
Output output;
output.clip = UnityObjectToClipPos(input.vertex);
output.normal = UnityObjectToWorldNormal(input.normal);
output.world = mul(unity_ObjectToWorld, input.vertex).xyz;
output.tint = input.tint;
output.body = input.body;
return output;
}
fixed4 frag(Output input) : SV_Target
{
// A gradual coverage ramp keeps changing service occupancy from cutting people in and out abruptly.
float noise = frac(dot(floor(input.clip.xy), float2(.754877, .56984)));
clip(input.tint.a - noise - .001);
float surface = input.body.w;
if (surface > 3.5)
return fixed4(input.tint.rgb, 1);
float3 normal = normalize(input.normal);
float sun = saturate(dot(normal, normalize(float3(-.69,.40,-.43))));
float3 eye = unity_OrthoParams.w > .5 ? UNITY_MATRIX_V[2].xyz : normalize(_WorldSpaceCameraPos.xyz - input.world);
float3 lightDirection = normalize(float3(-.69,.40,-.43));
float skin = 1 - saturate(abs(surface - 1));
float fabric = saturate(1 - surface);
float sun = saturate(dot(normal, lightDirection));
float subsurface = max(0, dot(normal, lightDirection) + .34) * .746;
float lightAngle = lerp(sun, subsurface, skin * .86);
float overhead = saturate(normal.y * .5 + .5);
float3 light = lerp(float3(.55,.63,.71), float3(.83,.88,.94), overhead)
+ sun * float3(.38,.29,.176);
return fixed4(saturate(input.tint.rgb * light), 1);
float3 bounce = lerp(float3(.53,.61,.71), float3(.83,.88,.94), overhead);
float3 light = bounce + lightAngle * lerp(float3(.33,.278,.232), float3(.43,.286,.21), skin);
float fresnel = pow(1 - saturate(dot(eye, normal)), 3);
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);
}
ENDCG
}