Vectrex emulator with GPU rendering
-
I've been playing about with GPU rendering in Vectrex emulators so see what sort of image improvements I can get with Pis.
Here's an example of what can be done:
As well as antialiased lines with transparency I've also figured out how to do glow/bloom in one render pass, rather than the several it usually takes, which makes it practical for Pis.
The code for the modified libretro core can be found at https://github.com/grolliffe/libretro-vecx
You can download and build it using
git clone https://github.com/grolliffe/libretro-vecx.git cd libretro-vecx make
There are various core options for changing things like line width, glow brightness, render resolution, etc. you can change from the Quick Menu->Options screen.
As my older Pis seem to be dying on me I've only been able to test it on a Pi4 so far. If you could test it on earlier Pi's and report back that will be helpful. I'm a bit doubtful about earlier Pis being able to maintain the full speed of 50 FPS. (Libretro's scheme for supporting hardware rendering is the core renders to a texture and the front end copies it to the framebuffer. This is obviously slower than just rendering direct to the framebuffer.) Setting the render resolution to lower than the screen resolution should speed things up so if lower end Pis do have a problem, please try that and report if it helps.
I should point out that it is not quite ready to be merged with the main project yet. In particular, I haven't been able to get libretro to switch between software and hardware rendering without problems so you need to exit the core and restart it. The easiest/fastest way to do this it to change the setting in the Quick Menu->Options screen and then start a different game. Only the renderer setting requires this.
Please try it out and report back on any successes and particularly failures you have.
Thanks.
dave j
-
Hi @davej just been looking at this post with interest. Wondering if this could be applied to other Libretro emulators, namely mame2003-plus. There have been some improvements to vector rendering in that core recently but your efforts here for vectrex remind me of the old AAE on the PC. It had bloom and glow but was never finished. I'm currently messing with Star Wars on a Pi3B+ using Advmame and mame2003-plus. I'm getting audio glitches when I try anything fancy like antialiasing. I suspect I could get better performance if I step up to a Pi4, but I'd love to see bloom and glow especially in one pass like you have achieved. I'm gonna have a play with some vertex stuff just to see how it looks on my setup. Keep up the good work!!
-
Looks amazing. Thanks.
-
@davej you've made my day. Running on Pi4B. I disabled my shader. Took a deep breath. No issues. I mean. So good. Wish I had constructive feedback to help you more, but I don't. Good luck with the project. Nice to see effort here, since it's been so long.
-
Impressive! Really brings back that vector monitor feeling.
Could this also be applied to lr-mess? @valerino 's new scriptmodules (lr-vice-xvic, gsplus, proper lr-mess integration!) also support Vectrex via custom scriptmodules and i was curious if this could be implemented here also?
-
I'll likely have a scriptmodule for this in a short bit, just trying to finish off something else first before I move over to this.
https://github.com/zerojay/RetroPie-Extra/blob/master/scriptmodules/libretrocores/lr-vecx.sh -
@james-milroy + @Rion :
There's no particular reason the technique couldn't be used in other emulators but I'm not sure how well it will work with colour games. It relies on the framebuffer's alpha channel to limit how bright the glow gets - the more glow gets written the less effect subsequent glow has. That works fine for monochrome but I can see potential problems with having three colour channels instead of one. e.g. What if the alpha value gets used up by multiple blue lines and then a green line is drawn (given green is much more visible than blue)? Will the green glow be attenuated too much? Would the effect be visible enough to notice? What happens on real arcade machines in such circumstances?@zerojay :
I'll be submitting request to incorporate this into the official Libretro Vectrex core in the next day or two. Don't put effort into creating a scriptmodule if it's going to be redundant soon. -
@davej said in Vectrex emulator with GPU rendering:
@zerojay :
I'll be submitting request to incorporate this into the official Libretro Vectrex core in the next day or two. Don't put effort into creating a scriptmodule if it's going to be redundant soon.It was about 5 minutes of work, no biggie.
-
I've made a few, mainly cosmetic, modifications and issued the pull request so it should be merged with the main project soon.
-
@davej said in Vectrex emulator with GPU rendering:
There's no particular reason the technique couldn't be used in other emulators but I'm not sure how well it will work with colour games.
I think it would be perfect for Asteroids (the 1979 Arcade game) which is not colour and would be particularly awesome to see the bullets with the Glow/Bloom effect that i remember so fondly when playing in the Arcade in 1979.
The way it's emulated in Retropie with any current emulator ... the bullets are really difficult to see without the "glow" effect :(
-
@ReadyPlayaWon Which emulator does ?
-
@ReadyPlayaWon said in Vectrex emulator with GPU rendering:
I think it would be perfect for Asteroids (the 1979 Arcade game) which is not colour and would be particularly awesome to see the bullets with the Glow/Bloom effect that i remember so fondly when playing in the Arcade in 1979.
The way it's emulated in Retropie with any current emulator ... the bullets are really difficult to see without the "glow" effect :(
It's really easy to scale the size of the dots/lines based on how bright they are. With the overbright values that Asteroids uses for bullets it would be possible to make them stand out by being bigger too. It does depend if the emulators support that though.
In other news, I've been investigating how it would look if applied to colour games:
My concerns about how it would work with colour are unfounded - any theoretical effects are not noticeable during games.Don't get too exited about that image. I hacked an emulator to add a grab current screen's vectors button and display the results in a separate program. That is very different from adding GPU rendering to an existing emulator.
-
It looks like the pull request for this was accepted 3 days ago. I'll remove my scriptmodule now.
-
Hi,
I tried your improvements. Looks really great :)
Thanks !Will the improvements soon be added in the master branche ?
-
@zerojay said in Vectrex emulator with GPU rendering:
It looks like the pull request for this was accepted 3 days ago.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.