Skip to content

Instantly share code, notes, and snippets.

@yorung
Created June 27, 2017 17:19
Show Gist options
  • Save yorung/b73d0819405bf066853c7fd0d5b29dc1 to your computer and use it in GitHub Desktop.
Save yorung/b73d0819405bf066853c7fd0d5b29dc1 to your computer and use it in GitHub Desktop.
[HLSL] Define a constant variables.
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