File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 11#version 300 es
2- precision mediump float ;
32
43uniform float dt;/* * time delta */
54uniform sampler2D rg; /* * random rg */
@@ -19,15 +18,15 @@ out vec2 oV;
1918
2019void main() {
2120 if (l <= 0 .f) {
22- int i = gl_VertexID ;
23- ivec2 ij = ivec2 (i % 200 , i / 200 ) ;
24- vec2 rd = texelFetch(rg, ij , 0 ).rg;
25- float th = aR.x + rd .r * (aR.y - aR.x);
21+ int i = gl_VertexID + 1000 * int (dt) ;
22+ vec2 q = texelFetch(rg, ivec2 ((i + 2 ) % 200 , 0 ), 0 ).rg ;
23+ vec2 r = texelFetch(rg, ivec2 (i % 200 , i / 200 ) , 0 ).rg;
24+ float th = aR.x + r .r * (aR.y - aR.x);
2625 float x = cos (th);
2726 float y = sin (th);
2827 oP = o;
29- oL = lR.x + rd .r * (lR.y - lR.x);
30- oV = vec2 (x, y) * (sR.x + rd .g * (sR.y - sR.x));
28+ oL = lR.x + q .r * (lR.y - lR.x);
29+ oV = vec2 (x, y) * (sR.x + r .g * (sR.y - sR.x));
3130 } else {
3231 oP = p + v * dt;
3332 oL = l - dt;
You can’t perform that action at this time.
0 commit comments