Ending: the Director's call, flyovers into orbit, Earth turning green, credits
When the planet is mown the ending plays by itself: G.R.A.S.S.A. calls, the camera skims the stubble into the base, circles it and rises without a cut into orbit over the bald planet (title, the crew's results). Then a jump across space to a scorched, dried-out Earth: a rocket from Herbaria-7 passes the lens and lands in Africa, and the green spreads from there over the whole globe (seed pods, a glowing front, clouds and blue air coming back). The credits roll over the green Earth (PlayWay credited as publisher), then THE END and a card to keep mowing, leave a review or go to the menu. Space, Enter or Esc skips to the green Earth and the card. - EndingCinematic, EndingEarth (globe, air shell, rocket, seeds), SpaceSky (split out of the intro), EarthGlobe/EarthAir shaders and Earth maps in Resources/Ending - the far meadow shows as stubble once the planet is mown - "all of it" mown now means no sector with grass left (MowMap.Left); mown area summed in double - the crew's total pay and play time are counted and saved for the results - the "ending" cheat; -ending previews it in a test world; the -ending bot shoots every stage - loc for the new lines in all 11 languages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
58
Assets/Resources/Ending/EarthAir.shader
Normal file
58
Assets/Resources/Ending/EarthAir.shader
Normal file
@ -0,0 +1,58 @@
|
||||
// The ending's Earth's air: a shell a little bigger than the ball, drawn from the inside, glowing just past the ball's edge
|
||||
// and fading out into space. Dusty brown while the ball is dead, blue once it lives.
|
||||
Shader "GrassCutter/EarthAir"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_SunDir ("Sun (world)", Vector) = (0, 0, 1, 0)
|
||||
_AirColor ("Air", Color) = (0.8, 0.55, 0.3, 1)
|
||||
_Edge ("Edge (cos at the ball's rim)", Float) = 0.33
|
||||
_Power ("Power", Float) = 1
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "RenderPipeline" = "UniversalPipeline" "IgnoreProjector" = "True" }
|
||||
Pass
|
||||
{
|
||||
Name "Air"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
Blend One One
|
||||
ZWrite Off
|
||||
Cull Front
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _SunDir;
|
||||
float4 _AirColor;
|
||||
float _Edge;
|
||||
float _Power;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; };
|
||||
struct Varyings { float4 positionCS : SV_POSITION; float3 normalWS : TEXCOORD0; float3 positionWS : TEXCOORD1; };
|
||||
|
||||
Varyings vert(Attributes v)
|
||||
{
|
||||
Varyings o;
|
||||
o.positionWS = TransformObjectToWorld(v.positionOS.xyz);
|
||||
o.positionCS = TransformWorldToHClip(o.positionWS);
|
||||
o.normalWS = TransformObjectToWorldNormal(v.normalOS);
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag(Varyings i) : SV_Target
|
||||
{
|
||||
float3 n = normalize(i.normalWS);
|
||||
float3 view = normalize(GetCameraPositionWS() - i.positionWS);
|
||||
// the far side of the shell: 0 at its own rim, _Edge where it meets the ball's rim
|
||||
float k = saturate(-dot(n, view) / _Edge);
|
||||
float glow = pow(k, 1.6) * (1 - smoothstep(0.92, 1.0, k) * 0.4);
|
||||
float lit = saturate(dot(n, normalize(_SunDir.xyz)) * 0.8 + 0.35);
|
||||
return float4(_AirColor.rgb * glow * lit * _Power, 1);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user