File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ out vec2 oV;
1919
2020void main() {
2121 if (l <= 0 .f) {
22- ivec2 ij = ivec2 (gl_VertexID % 512 , gl_VertexID / 512 );
22+ int i = gl_VertexID ;
23+ ivec2 ij = ivec2 (i % 200 , i / 200 );
2324 vec2 rd = texelFetch(rg, ij, 0 ).rg;
2425 float th = aR.x + rd.r * (aR.y - aR.x);
2526 float x = cos (th);
Original file line number Diff line number Diff line change @@ -206,16 +206,18 @@ const simulate = (
206206
207207 const rgNoiseTexture = gl . createTexture ( ) ;
208208 gl . bindTexture ( gl . TEXTURE_2D , rgNoiseTexture ) ;
209+ gl . activeTexture ( gl . TEXTURE0 ) ;
210+
209211 gl . texImage2D (
210212 gl . TEXTURE_2D ,
211213 0 ,
212214 gl . RG8 ,
213- 512 ,
214- 512 ,
215+ 200 ,
216+ 200 ,
215217 0 ,
216218 gl . RG ,
217219 gl . UNSIGNED_BYTE ,
218- randomRGData ( 512 , 512 ) ,
220+ randomRGData ( 200 , 200 ) ,
219221 ) ;
220222
221223 gl . texParameteri ( gl . TEXTURE_2D , gl . TEXTURE_WRAP_S , gl . MIRRORED_REPEAT ) ;
@@ -262,9 +264,6 @@ const simulate = (
262264 // skipcq: JS-0339 -- set in default options
263265 const speedRange = options . speedRange ! ;
264266 setUpdateUniform ( U_SPEED_RANGE , speedRange [ 0 ] , speedRange [ 1 ] ) ;
265- gl . activeTexture ( gl . TEXTURE0 ) ;
266- gl . bindTexture ( gl . TEXTURE_2D , rgNoiseTexture ) ;
267- setUpdateUniform ( U_RANDOM_RG , 0 ) ;
268267
269268 gl . bindVertexArray ( vertexArrayObjects [ readIndex ] ) ;
270269 gl . bindBufferBase ( gl . TRANSFORM_FEEDBACK_BUFFER , 0 , buffers [ writeIndex ] ) ;
You can’t perform that action at this time.
0 commit comments