Created
June 27, 2017 17:19
-
-
Save yorung/b73d0819405bf066853c7fd0d5b29dc1 to your computer and use it in GitHub Desktop.
[HLSL] Define a constant variables.
This file contains 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
static float3 lightPosition = { 100, 0, 1000 }; // 'static' needed. not 'const'! | |
float3 CalcLightDir(float3 myPosition) | |
{ | |
return normalize(lightPosition - myPosition); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment