Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float hash( vec2 p ) {
- float h = dot(p,vec2(127.1,311.7));
- return fract(sin(h)*43758.5453123);
- }
- vec3 randTorScatter(vec4 tex_pos){
- vec2 tor_param = vec2(cut_radius,tor_in_radius);
- float u = hash(vUV.st + tex_pos.xw/1000. + u_time);
- float x1 = hash(vUV.st + tex_pos.yx+ u_time)*2.-1.;
- float x2 = hash(vUV.st + tex_pos.xz+ u_time)*2.-1.;
- float x3 = hash(vUV.st + tex_pos.xw+ u_time)*2.-1.;
- float mag = sqrt(x1*x1 + x2*x2 + x3*x3);
- x1 /= mag; x2 /= mag; x3 /= mag;
- float c = sqrt(u)*tor_param.y*0.2;
- float angle = hash(vUV.st + tex_pos.xx+ u_time);
- float x_big = tor_param.x*sin(angle*2*PI)*1.1;
- float z_big = tor_param.x*cos(angle*2*PI)*1.1;
- return vec3(x1*c + x_big, x2*c , x3*c+ z_big);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement