Vectrex render is low-res, aliased

Take a look.

At the top we have the 2007 Vectrex emulator “Vecx” running at its default resolution of 330x410. Said emulator lets you specify a resolution, which I did for the second example, which is the same graphics rendered at 825x1025. In both cases, while the user doesn’t seem to have any control over the visuals, the lines are drawn thick and reasonably anti-aliased; they are not strictly comprised of pure black or pure white pixels.

The bottom example is the output from the vecx core. The lines are drawn digitally at Vecx’s default resolution of 330x410 (regardless of the output resolution) and upscaled with a bilinear filter. This is a poor base from which to begin adding filters, and no filter on the planet can adequately erase its digital nature.

I have tried plugging in Vecx’s command line functions for specifying the render resolution. This would not solve the fundamental issue of the lines being drawn digitally, but it could alleviate it somewhat. In any event, it doesn’t work. And the core does not seem to have any options available to it.

Right now, it seems like the correct solution is to go with the old emulator, and lose out on shaders. What am I missing?

1 Like

The core indeed renders at low res. I’ve tried cranking up the res but it makes the core very slow (it’s doing all of the rendering in software) and it messes up the “pitch” (makes everything weird and slanted; this is easy to fix but I don’t know how to do it).

I’ll try to take another stab at it soon, since even doubling the res helps significantly.

I think if you could pin down why the lines are being rendered digitally (black and white pixels) rather than as the smooth specimens provided by the actual emulator, that would be a far more important step than enabling the emulator’s custom resolution feature. I believe starting with a base of 330x410 nicely anti-aliased would actually be preferable to starting with a base of 1080p with digital lines.

I put in a PR for increased internal res, which seems to help quite a bit. You can also use AA shaders on the output (3x internal res with FXAA looks pretty good, IMO).

You’re right that it uses Bresenham’s algorithm for rasterizing lines, which doesn’t allow for anti-aliasing. Wu’s algorithm would probably look a lot nicer, but it’s also significantly more complex.