Help with Rate Calculation Based on deltaTime

I have a quick math question:
I’m modifying a screen rain distortion module, and I have a rate at which I spawn rain droplets measured in droplets per second. In a Heartbeat event connection, I need to calculate whether or not a droplet needs to be rendered or not, and if so, how many droplets need to be spawned, all based on the rate value and deltaTime. I have no idea how to approach this.

Are you trying to get the amount of droplets that are being rendered every X time?
I am sorry if I misunderstood your question.

Every frame, I need to calculate how many rain droplets, if any, need to be spawned based on Heartbeat’s deltaTime parameter and the rate per seconds constant variable.

Why would you base this on FPS though?

This is based on FPS because I want the droplets to spawn at a constant rate no matter what your FPS is. You can read more about this sort of tech here:

The post does not answer my question though and I’m having a tough time visualizing what the math will look like so I’m asking for help here.

1 Like