Created
August 11, 2017 15:42
-
-
Save KumoKairo/97354e4183ae9c3e8c48c1af0591427e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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