Skip to content

Instantly share code, notes, and snippets.

@yorung
Last active June 27, 2017 17:18
Show Gist options
  • Save yorung/04a70f36c09c59268da055ce5ae99779 to your computer and use it in GitHub Desktop.
Save yorung/04a70f36c09c59268da055ce5ae99779 to your computer and use it in GitHub Desktop.
[HLSL] Variables will not initialized.
float3 lightPosition = { 100, 0, 1000 }; // This makes an implicit constant buffer, but the light position never assigned!
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