Skip to content

Commit

Permalink
Merge pull request #14 from GeraldKimmersdorfer/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
GeraldKimmersdorfer authored Dec 1, 2023
2 parents 45f331d + 36e1221 commit b97fbb6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions gl_engine/shaders/snow.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@
#define ORIGIN_SHIFT 20037508.3427892430765884
#define PI 3.1415926535897932384626433

mediump float mod289(mediump float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
mediump vec4 mod289(mediump vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
mediump vec4 perm(mediump vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }
highp float mod289(highp float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
highp vec4 mod289(highp vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
highp vec4 perm(highp vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }

mediump float noise(mediump vec3 p){
mediump vec3 a = floor(p);
mediump vec3 d = p - a;
highp float noise(highp vec3 p){
highp vec3 a = floor(p);
highp vec3 d = p - a;
d = d * d * (3.0 - 2.0 * d);
mediump vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);
mediump vec4 k1 = perm(b.xyxy);
mediump vec4 k2 = perm(k1.xyxy + b.zzww);
mediump vec4 c = k2 + a.zzzz;
mediump vec4 k3 = perm(c);
mediump vec4 k4 = perm(c + 1.0);
mediump vec4 o1 = fract(k3 * (1.0 / 41.0));
mediump vec4 o2 = fract(k4 * (1.0 / 41.0));
mediump vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);
mediump vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
highp vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);
highp vec4 k1 = perm(b.xyxy);
highp vec4 k2 = perm(k1.xyxy + b.zzww);
highp vec4 c = k2 + a.zzzz;
highp vec4 k3 = perm(c);
highp vec4 k4 = perm(c + 1.0);
highp vec4 o1 = fract(k3 * (1.0 / 41.0));
highp vec4 o2 = fract(k4 * (1.0 / 41.0));
highp vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);
highp vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);
return o4.y * d.y + o4.x * (1.0 - d.y);
}

Expand Down

0 comments on commit b97fbb6

Please sign in to comment.