Is the post seasonal depression bogging you down and after christmas you have

drank all of the liquor and candy canes that you can possible allow inside the system.

And you are now looking for a fun side project to simulate the good times

glbe

I have a cool exciting snow simulation to remember the good times

of yonder past and feel extremely good about your life.

childhood

Step 1

send a subdivided number of quadrateral polygons in array formation to your GPU device,

along side each vertex will be accompanied with a displacement vector which is generated from

a vector field.

SubdividedPlane = new SubdividedPlane()

Quadrateral = new QuaderateralMesh

Quadrateral.bind()

// Create a shader to transform the positions

VertexShader =

ivec2 pixel = ivec2( gl_InstanceID % xdiv, gl_InstanceID / xdiv )

vec4 location = texelFetch ( positions, pixel )

gl_Position = location


// Bind the positions of each vertex into a vertex position texture

// For each quad there are 4 vertexes and so if there are xdiv*ydiv quads then * 4 for the number of

// vertexes

Texture positions = new Texture2D( xdiv*4, ydiv, RGBA )

DrawInstanced (  xdiv*ydiv )

Step 2

simulate a vector field which updates each frame based on the results of a simple line integral

then query each vertex point within the vector field to retrieve a wonderful position vector.

let V be our vector field and the inital state of the vector field is zero

then the change of our vector field is increasing vertical at the rate C

which is the rate or amount of snow falling per second

as well as another term which is a change in mass field which is updated to the mass

of an object that has moved through the scene overall


dV = C + M


assuming that C is smooth function

and M is a smooth function, or a discrete set of values which have been least squared

etc etc


we simply find V by integrating the two functions.

Step 3

update the GPU displacement texture each frame associated with each vertex of the wonderfully

complexified plane.

assume that we have a list of vectors solved by the loop previously mentioned which

adds up the snow fallen and difference in mass from neutrality.


then we update the texture by passing the new data to it.

BindTexture2D(positions)

TextureImage2D( updated_positions )

In post discussion do you believe that this would be a fun moment to enjoy with the family

to show your cool snow simulation?