Skip to content

Instantly share code, notes, and snippets.

@KumoKairo
Created August 11, 2017 15:42
Show Gist options
  • Save KumoKairo/97354e4183ae9c3e8c48c1af0591427e to your computer and use it in GitHub Desktop.
Save KumoKairo/97354e4183ae9c3e8c48c1af0591427e to your computer and use it in GitHub Desktop.
half4 frag(v2f i) : COLOR
{
half p = i.texcoord.y;
float p1 = pow(min(1.0f, 1.0f - p), _Exponent);
float p2 = 1.0f - p1;
// Our moon circle
half3 mie = calcSunSpot(_SunPosition.xyz, i.texcoord.xyz) * _SunColor;
// Blend ground fog with the moon
half3 col = _GroundColor * p1 + mie * p2;
// Add sky color
col += _SkyTint * p2;
return half4(col, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment