Skip to content

Instantly share code, notes, and snippets.

@johansten
Created September 5, 2012 09:17
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johansten/3633917 to your computer and use it in GitHub Desktop.
Save johansten/3633917 to your computer and use it in GitHub Desktop.
The canonical "fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453)" didn't work on Mali-400, so replaced sin() w/ approximation
float a = fract(dot(v_texCoord.xy, vec2(2.067390879775102, 12.451168662908249))) - 0.5;
float s = a * (6.182785114200511 + a*a * (-38.026512460676566 + a*a * 53.392573080032137));
float t = fract(s * 43758.5453);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment