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

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e56d5a9302de9e3649fdeea410a85484
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

View File

@@ -0,0 +1,132 @@
fileFormatVersion: 2
guid: 172b54f5454d9e37285b5cf49fb24bb2
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@@ -0,0 +1,132 @@
fileFormatVersion: 2
guid: 4c2c01956c6f6646da63d660abe3c0c8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@@ -0,0 +1,132 @@
fileFormatVersion: 2
guid: d1bc5d35767d6500e9757ef66fd43f28
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationMethod: 0
spriteTessellationDetail: -1
spriteGeometrySubdivision: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -7,6 +7,13 @@ Shader "Soundings/Harbor Water"
_BackdropCrop ("Harbor crop", Vector) = (1,1,0,0)
_HullSpan ("Hull length and beam", Vector) = (71,7,0,0)
_HullCourse ("Hull heading and wake strength", Vector) = (1,0,0,0)
_PortBerth ("Cinematic berth position and dimensions", Vector) = (0,0,0,0)
_PortMotion ("Port maneuver", Float) = 0
_PortSky ("Port sunset color", Color) = (.86,.62,.43,1)
_PortShallows ("Shallow harbor water", Range(0,1)) = .25
_PortMatte ("Port waterfront matte", 2D) = "black" {}
_PortMatteCrop ("Port waterfront crop", Vector) = (1,1,0,0)
_PortMatteActive ("Port waterfront matte is available", Float) = 0
_Underway ("Open water", Float) = 0
_WeatherSeverity ("Sea conditions", Range(0,1)) = 0
}
@@ -24,10 +31,11 @@ Shader "Soundings/Harbor Water"
#include "UnityCG.cginc"
#include "OceanWaves.cginc"
sampler2D _Backdrop, _OceanDetail;
float4 _BackdropCrop, _HullSpan, _HullCourse, _ViewSize;
sampler2D _Backdrop, _OceanDetail, _PortMatte;
float4 _BackdropCrop, _HullSpan, _HullCourse, _PortBerth, _ViewSize;
float4 _PortSky, _PortMatteCrop;
float3 _ViewOrigin, _ViewForward, _ViewRight, _ViewUp;
float _Underway, _WeatherSeverity, _SeaTime;
float _Underway, _WeatherSeverity, _SeaTime, _PortMotion, _PortShallows, _PortMatteActive;
static const float3 Sun = float3(-.761,.441,-.474);
struct Output { float4 clip : SV_POSITION; float2 screen : TEXCOORD0; };
@@ -47,6 +55,11 @@ Shader "Soundings/Harbor Water"
float elevation = sqrt(saturate(ray.y));
float3 sky = lerp(horizon, float3(.081,.242,.408), elevation);
float3 squall = lerp(float3(.41,.50,.56), float3(.112,.174,.230), elevation);
if (_PortMotion > .5)
{
float3 shoreGlow = lerp(float3(.62,.70,.76), _PortSky.rgb, .28 + warmth * .64);
sky = lerp(shoreGlow, float3(.16,.30,.48), elevation);
}
return lerp(sky, squall, _WeatherSeverity);
}
@@ -149,6 +162,11 @@ Shader "Soundings/Harbor Water"
float cap = saturate(dot(normal, Sun) * .84 + (chop.b - .5) * textureDetail * .63 + .35);
float3 fromBelow = lerp(float3(.028,.125,.192), float3(.078,.250,.294), cap);
fromBelow = lerp(fromBelow, fromBelow * .57 + float3(.022,.032,.036), _WeatherSeverity);
if (_PortMotion > .5)
{
float3 shallowWater = lerp(float3(.03,.31,.32), float3(.15,.52,.48), cap);
fromBelow = lerp(fromBelow, shallowWater, _PortShallows);
}
float3 color = lerp(fromBelow, SkyGradient(reflected) * .83, reflection);
float sunHit = saturate(dot(reflected, Sun));
float nearSun = pow(sunHit, lerp(162, 60, _WeatherSeverity));
@@ -172,6 +190,11 @@ Shader "Soundings/Harbor Water"
color = lerp(color, float3(.88,.94,.94), foam.y);
}
}
if (_PortMotion > .5)
{
float2 quayEdge = max(0, abs(position - _PortBerth.xy) - _PortBerth.zw);
color *= 1 - (1 - smoothstep(.14, 3.4, length(quayEdge))) * .29;
}
float mist = 1 - exp(-distance * (.00040 + .00077 * _WeatherSeverity));
color = lerp(color, SkyGradient(float3(ray.x, 0, ray.z)) * .90, mist * .80);
@@ -186,6 +209,23 @@ Shader "Soundings/Harbor Water"
return color;
}
float3 PortMatteWater(float3 origin, float3 ray, float2 screen)
{
float2 uv = (screen - .5) * _PortMatteCrop.xy + .5 + _PortMatteCrop.zw;
float water = 1 - smoothstep(.28,.55,uv.y);
float viewDistance = clamp(origin.y / max(.00042, -ray.y), 0, 1200);
float2 world = origin.xz + ray.xz * viewDistance;
float ripple = sin(dot(world, float2(.54,1.16)) - _SeaTime * 1.72);
uv.x += ripple * (.00058 * water);
float3 matte = tex2D(_PortMatte, uv).rgb;
if (water < .009 || ray.y > 0)
return matte;
float3 sea = OpenSea(origin, ray, screen);
// Preserve the distant quay's photographic reflection while the ship and its wake move over live water.
return lerp(matte, sea, water * .74);
}
fixed4 frag(Output input) : SV_Target
{
float2 screen = input.screen;
@@ -193,7 +233,9 @@ Shader "Soundings/Harbor Water"
float3 viewOffset = offsetOnFilm.x * _ViewRight + offsetOnFilm.y * _ViewUp;
float3 origin = _ViewOrigin + viewOffset * _ViewSize.z;
float3 ray = normalize(_ViewForward + viewOffset * (1 - _ViewSize.z));
if (_Underway > .5)
if (_PortMotion > .5 && _PortMatteActive > .5)
return fixed4(PortMatteWater(origin, ray, screen), 1);
if (_Underway > .5 || _PortMotion > .5)
{
if (ray.y >= .0010)
return fixed4(Sky(ray, _SeaTime), 1);

View File

@@ -5,6 +5,51 @@
top: 0;
bottom: 0;
}
.port-cinematic { flex-grow: 1; background-color: #070d10; }
.port-cinematic-bar {
position: absolute;
left: 0;
right: 0;
background-color: #080e11;
}
.port-cinematic-top { top: 0; height: 7%; }
.port-cinematic-bottom { bottom: 0; height: 11%; justify-content: center; }
.port-cinematic-title-card {
position: absolute;
left: 4%;
top: 0;
bottom: 0;
justify-content: center;
}
.port-cinematic-kicker { color: #d8b675; font-size: 10px; letter-spacing: 3px; }
.port-cinematic-title { color: #f5edda; font-size: 31px; }
.port-cinematic-caption {
align-self: center;
width: 49%;
font-size: 13px;
white-space: normal;
color: #d8e2e0;
-unity-text-align: middle-center;
}
.action.port-cinematic-skip {
position: absolute;
right: 4%;
bottom: 29%;
height: 31px;
min-height: 31px;
min-width: 92px;
color: #d8c497;
background-color: #142129;
border-color: #5d5544;
}
.port-cinematic-fade {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #080e11;
}
.voyage-business {
position: absolute;
left: 30px;

View File

@@ -17,7 +17,7 @@ Shader "Soundings/Passage Wake"
#include "OceanWaves.cginc"
sampler2D _OceanDetail;
float _SeaTime, _WeatherSeverity, _TrailLength;
float _SeaTime, _WeatherSeverity, _TrailLength, _SoundingsSeaSailing;
struct Input { float4 vertex : POSITION; float4 trace : TEXCOORD0; };
struct Output { float4 clip : SV_POSITION; float4 trace : TEXCOORD0; float2 water : TEXCOORD1; };
@@ -25,7 +25,7 @@ Shader "Soundings/Passage Wake"
{
Output output;
float3 vertex = input.vertex.xyz;
vertex.y += OceanWave(vertex.xz, _SeaTime, _WeatherSeverity).x;
vertex.y += OceanWave(vertex.xz, _SeaTime, _WeatherSeverity).x * _SoundingsSeaSailing;
output.clip = UnityObjectToClipPos(float4(vertex, 1));
output.trace = input.trace;
output.water = vertex.xz;

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
}

View File

@@ -0,0 +1,95 @@
Shader "Soundings/Port Scenery Surface"
{
Properties
{
_Color ("Material color", Color) = (.65,.64,.58,1)
_HazeColor ("Harbor atmosphere", Color) = (.60,.63,.66,1)
_Detail ("Surface finish", Float) = 0
_Glow ("Window light", Range(0,1)) = 0
}
SubShader
{
Tags { "RenderType"="Opaque" }
Cull Off
Pass
{
CGPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
float4 _Color, _HazeColor;
float _Detail, _Glow;
struct Input { float4 position : POSITION; float3 normal : NORMAL; };
struct Output { float4 screen : SV_POSITION; float3 position : TEXCOORD0; float3 normal : TEXCOORD1; };
Output vert(Input input)
{
Output output;
output.screen = UnityObjectToClipPos(input.position);
output.position = mul(unity_ObjectToWorld, input.position).xyz;
output.normal = UnityObjectToWorldNormal(input.normal);
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);
}
fixed4 frag(Output input, fixed side : VFACE) : SV_Target
{
float3 p = input.position;
float3 n = normalize(input.normal) * (side >= 0 ? 1 : -1);
float3 view = normalize(_WorldSpaceCameraPos.xyz - p);
float3 sun = normalize(float3(-.69,.40,-.43));
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 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 *= lerp(.72, 1, smoothstep(-.12, 1.4, p.y));
}
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)));
}
if (_Detail == 4)
albedo *= .87 + relief * .16 + fine * .12 + coarse * .13;
float diffuse = saturate(dot(n, sun));
float sky = n.y * .5 + .5;
float3 bounce = lerp(float3(.28,.32,.43),float3(.67,.71,.78),sky);
float3 color = albedo * (bounce + diffuse * float3(.71,.51,.33));
if (_Detail == 3)
{
float reflectedSky = saturate(reflect(-view, n).y * 2 + .11);
float edge = pow(1 - saturate(dot(n, view)), 2.4);
float3 reflection = lerp(float3(.13,.22,.27), _HazeColor.rgb * .85, reflectedSky);
color = lerp(color, reflection, (.44 + .51 * edge) * (1 - _Glow)) + _Color.rgb * _Glow;
}
float distance = length(_WorldSpaceCameraPos.xyz - p);
float haze = smoothstep(120, 640, distance) * .87;
return fixed4(lerp(color, _HazeColor.rgb, haze), 1);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3778ac428b0413a25ac9b31557166e96
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: