Gravitational calculation of a particle via GLSL / WebGL I have a running particle system which emits particles in a given radius. Now I want to add some gravity to it. The particles and velocities of each particle is saved in a 2D Texture, now I want another 2D Texture, where I can save the gravity, but i'm missing the knowledge to do so.
What's the actual formula on creating some gravitation or how can it be simulated?

For example to save particle's vel, I have
    uniform sampler2D pv;
which is just an image which outputs an image and takes the output as input into the shader. (Kind of transform feedback)

uniform float spread;
vec2 vel = ...;
gl_FragColor = vec4(spread*vel, 0.0, 0.0);

(Part of my code)

And now I simply want another uniform sampler2D pg; which holds gravity and right here, I'm missing the math...
Gravity is a form of acceleration. So what I've done in the past is continually add it into the velocity. On each frame, for each particle, I'd do something like this:

// Gravitational acceleration, adjust as necessary
const vec2 gravity = vec2(0.0, -9.8);

// Calculate the new velocity for the particle 
velocity = (particleVelocity + gravity) * timeDelta;

// Calculate the new position given the new velocity
newParticlePosition = particlePosition + velocity;

// Update our parameters for the next time around
particleVelocity = velocity / timeDelta;
particlePosition = newParticlePosition;


In this case timeDelta is the fraction of a second between the previous frame and the current frame. So if you're running your animation at 60 fps, it would be 1.0 / 60.0 = 0.01666…

I'm not sure that using a texture for the gravity would help you here as gravity is usually a constant when you're close to the surface of the planet, as it sounds like your particles are from the description given.