Heartbeat effect without dropping FPS to 1

Hey everyone,

I was looking at my horror story gamemode and figured I should add heartbeats to the Player list (TAB). I toyed around with textures but they didn’t do what I wanted them to do, so now I’m going for a simple draw approach.

The effect I want to accomplish is something like this;

Using this with a lot of math to determine each line every single frame is a pain in the ass, so does anyone know a way to draw a heartbeat to some sort of buffer, which you can then just shift a little to add the next pixel to it?

Any other ideas are welcome aswell, so feel free to speak!


You could have a scrolling texture which is scissored; I do something similar for my voice volume system except it completes the box so even if you to render the points each frame it won’t be a big hit but the scrolling texture would probably be the fastest.

Basically take 2 of the same and set them side by side, move them towards the left and use % to calculate the positions so when it’s at the left limit it brings it to the right side of the other texture.

There might be a different way to do it by using matrices or something but I’m not sure at the moment; I can dig a bit further after I’m done with a few things, but that might help you get started…

Additionally, animated transparent images can be shown on screen by using a transparent HTML vgui window.