Skip to content

Instantly share code, notes, and snippets.

@Pwootage
Created July 13, 2011 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pwootage/1081581 to your computer and use it in GitHub Desktop.
Save Pwootage/1081581 to your computer and use it in GitHub Desktop.
Light cycler
try
{
directions[0] = directions[0];
}
catch (exception)
{
directions = new Array();
for (i = 0; i < 16; i++)
{
directions[i] = 1;
}
}
for (var i = 0; i < 16; i++)
{
var oldVal = effect.getLightRampValue(i);
oldVal += directions[i] * 0.05;
if (oldVal > 1.0)
{
directions[i] = -1;
}
if (oldVal <= 0.0)
{
directions[i] = 1;
}
effect.setLightRampValue(i, oldVal);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment