Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. float NS(vec3 p){ // Shitty simplex noise
  2. vec3 q=floor(p),f=-cos((p-q)*3.141)*.5+.5;
  3. vec4 a=dot(q,vec3(1,57,21))+vec4(0,57,21,78);
  4. a=mix(sin(cos(a)*a),sin(cos(1.+a)*(1.+a)),f.x);
  5. a.xy=mix(a.xz,a.yw,f.y);
  6. return mix(a.x,a.y,f.z);
  7. }
  8.  
  9. float Plane(vec3 p){
  10. //float d=sin(p.x)/10.+sin(p.z)/10.; // Again with cheap-ass "noise"
  11. return p.y
  12. +NS(p)*.5 // Note multi-octave shiznitz
  13. +NS(p*2.)*sin(t/10.)*.1
  14. +NS(p*4.)*sin(t/10.)*.05;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement