@@ -24,6 +24,11 @@ export class WindGL {
2424 constructor ( gl ) {
2525 this . gl = gl ;
2626
27+ this . fadeOpacity = 0.999 ;
28+ this . speedFactor = 0.2 ;
29+ this . dropRate = 0.003 ;
30+ this . dropRateBump = 0.01 ;
31+
2732 this . drawProgram = util . createProgram ( gl , drawVert , drawFrag ) ;
2833 this . screenProgram = util . createProgram ( gl , quadVert , screenFrag ) ;
2934 this . updateProgram = util . createProgram ( gl , quadVert , updateFrag ) ;
@@ -86,7 +91,7 @@ export class WindGL {
8691 util . bindFramebuffer ( gl , this . framebuffer , this . screenTexture ) ;
8792 gl . viewport ( 0 , 0 , gl . canvas . width , gl . canvas . height ) ;
8893
89- this . drawTexture ( this . backgroundTexture , 0.999 ) ;
94+ this . drawTexture ( this . backgroundTexture , this . fadeOpacity ) ;
9095 this . drawParticles ( ) ;
9196
9297 util . bindFramebuffer ( gl , null ) ;
@@ -149,6 +154,9 @@ export class WindGL {
149154 gl . uniform2f ( program . u_wind_res , this . windData . width , this . windData . height ) ;
150155 gl . uniform2f ( program . u_wind_min , this . windData . uMin , this . windData . vMin ) ;
151156 gl . uniform2f ( program . u_wind_max , this . windData . uMax , this . windData . vMax ) ;
157+ gl . uniform1f ( program . u_speed_factor , this . speedFactor ) ;
158+ gl . uniform1f ( program . u_drop_rate , this . dropRate ) ;
159+ gl . uniform1f ( program . u_drop_rate_bump , this . dropRateBump ) ;
152160
153161 gl . drawArrays ( gl . TRIANGLES , 0 , 6 ) ;
154162
0 commit comments