First of all: Great plugin, exactly what I was looking for!
TLDR: I made some experimental changes to it that seem to improve rendering performance quite a lot.
I've just gotten into VaM plugin development and have been experimenting a bit, and had a quick idea on how to improve the plugin's performance a bit. As Eosin reported, much of the time is spent in the JPEG/PNG encoding step, so I thought this might be improved simply with multi-threading: The frames can be rendered into alternating textures, and those textures are then encoded to JPEG/PNG in separate threads. This way, rendering and encoding happen simultaneously, and multiple frames can be encoded (not rendered) at the same time on multi-core processors.
I experimented a bit with this, and it turned out to be surprisingly simple and effective. The results depend quite a bit on the scene complexity, but testing with a pretty average scene and 4K Stereo180 JPEG rendering, I rendered with ~390fpm before the changes, and ~760fpm after. For PNG rendering, it seems to be even more dramatic, with ~150fpm before and ~570fpm after. I'm using an RTX 3060 Ti and a Ryzen 7 7700X. These were just very crude measurements and YMMV, but I think that's pretty good for something quickly hacked together in a day.
I've only done very basic testing, and I'm not that experienced with C#, so I'm not confident that it always works. But if someone wants to try it out, I've created
a GitHub repository with the changes (it's really only Eosin_VRRenderer.cs that has changed). I've also uploaded a
modified VAR file that should just work as a drop-in replacement. Multi-Threading is enabled by default, and there are two new UI controls in the very bottom right for setting the thread count (might have to try around with different values) or reverting to the old non-threaded behavior.