Skip to content

Instantly share code, notes, and snippets.

@mortennobel
Created October 17, 2013 06:57
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 mortennobel/7020252 to your computer and use it in GitHub Desktop.
Save mortennobel/7020252 to your computer and use it in GitHub Desktop.
plasma effect (from Unity's RenderingPluginExample42)
// Simple oldskool "plasma effect", a bunch of combined sine waves
// input x,y (uv-coordinates), t (time)
int vv = int(
(127.0f + (127.0f * sinf(x/7.0f+t))) +
(127.0f + (127.0f * sinf(y/5.0f-t))) +
(127.0f + (127.0f * sinf((x+y)/6.0f-t))) +
(127.0f + (127.0f * sinf(sqrtf(float(x*x + y*y))/4.0f-t)))
) / 4;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment