Created
August 11, 2017 15:21
-
-
Save KumoKairo/a1cabe7ca567ed24d71280aad8131e0c 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
#define HARDNESS_EXPONENT_BASE 0.125 | |
half calcSunSpot(half3 sunDirPos, half3 skyDirPos) | |
{ | |
half3 delta = sunDirPos - skyDirPos; | |
half dist = length(delta); | |
half spot = 1.0 - smoothstep(0.0, _SunSize, dist); | |
return 1.0 - pow(HARDNESS_EXPONENT_BASE, spot * _SunHardness); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment