Vector games how to get better image

mr_mr_mr
Posts: 14
Joined: Thu Apr 01, 2021 12:15 pm
Been thanked: 1 time

Vector games how to get better image

Unread post by mr_mr_mr »

I am interested in playing Gravitar but I am unsure how/if can I get better image quality. I am using hdmi and 1080p and the lines are not solid but dotted so to speak. I understand that this might be a limitation of original display being vector crt and that there is nothing to be done, but if there is some settings I can try to change, please advice.
mic_
Posts: 33
Joined: Thu May 28, 2020 8:45 am
Has thanked: 1 time
Been thanked: 5 times

Re: Vector games how to get better image

Unread post by mic_ »

To get it to look more like on the original arcade machine, the core would probably have to add some antaliasing when rendering the vectors. And possibly some slight "glow" around the vectors as well.

For a software emulator that shouldn't be that much of an issue, but I have no idea how practical it would be for a MiSTer core to do that. Perhaps it could be done in the form of a video filter instead of being part of the core(?).
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Vector games how to get better image

Unread post by LamerDeluxe »

It is a real shame that the vector games don't look better. I am experienced in graphics programming, but I couldn't find where the vector drawing code was in MiSTer, assuming that part is done on the ARM CPU.

You'd need a higher resolution, anti-aliased bresenham line drawing and a two pass Gaussian blur for glow. For a better result you'd have to use additive blending. And then you should really vary the brightness of a vector according to the speed it is being drawn at.

For the best vector simulation you'd need HDR support, but the MiSTer can't output that.

I'm still hoping for some kind of solution with which you could attach a real vector display, or a CRT oscilloscope.
User avatar
jimmystones
Core Developer
Posts: 218
Joined: Sun Nov 22, 2020 1:26 pm
Location: Reading, UK
Has thanked: 32 times
Been thanked: 251 times
Contact:

Re: Vector games how to get better image

Unread post by jimmystones »

It's all on the FPGA side, the ARM CPU doesn't get involved in graphics really.

All the rendering on the vector cores I've seen has been using the original beam control signals to plot pixels on a frame buffer. It's usually double buffered so a completed image is being output to vga while the next one is drawn.

Here is the module in asteroids:
https://github.com/MiSTer-devel/Arcade- ... ids_dw.vhd

Putting image processing stages in to make it look nicer is probably possible, but sounds complicated to achieve in HDL to me :)
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Vector games how to get better image

Unread post by jca »

LamerDeluxe wrote: Thu Apr 29, 2021 10:03 pm It is a real shame that the vector games don't look better. I am experienced in graphics programming, but I couldn't find where the vector drawing code was in MiSTer, assuming that part is done on the ARM CPU.
It is done in the FPGA.
LamerDeluxe wrote: Thu Apr 29, 2021 10:03 pm You'd need a higher resolution, anti-aliased bresenham line drawing and a two pass Gaussian blur for glow. For a better result you'd have to use additive blending. And then you should really vary the brightness of a vector according to the speed it is being drawn at.
It depends on how much time there is to accomplish this. The 6809 is not a speed demon so I guess there is time to improve the drawing.
LamerDeluxe wrote: Thu Apr 29, 2021 10:03 pm I'm still hoping for some kind of solution with which you could attach a real vector display, or a CRT oscilloscope.
I have been thinking about that for quite sometimes, in particular after reading on Hackaday about a project using an oscilloscope as the display. It was not done on FPGA but on a custom PCB using original components but for the part driving the scope.
alanswx
Core Developer
Posts: 300
Joined: Sun May 24, 2020 6:55 pm
Has thanked: 5 times
Been thanked: 154 times

Re: Vector games how to get better image

Unread post by alanswx »

I think battlezone looks better. I am not sure why it looks so low resolution. Of course it is a bit low resolution.

Battlezone has a different rendering engine.
dmckean
Posts: 310
Joined: Sat Jan 16, 2021 7:03 am
Has thanked: 396 times
Been thanked: 95 times

Re: Vector games how to get better image

Unread post by dmckean »

jimmystones wrote: Thu Apr 29, 2021 10:22 pm It's all on the FPGA side, the ARM CPU doesn't get involved in graphics really.

All the rendering on the vector cores I've seen has been using the original beam control signals to plot pixels on a frame buffer. It's usually double buffered so a completed image is being output to vga while the next one is drawn.

Here is the module in asteroids:
https://github.com/MiSTer-devel/Arcade- ... ids_dw.vhd

Putting image processing stages in to make it look nicer is probably possible, but sounds complicated to achieve in HDL to me :)
It would be cool if we could output the raw beam control signals to some sort of external image processor and outputs realistic looking vector graphics.
hitm4n
Posts: 116
Joined: Sat Jan 30, 2021 9:20 am
Has thanked: 3 times
Been thanked: 25 times

Re: Vector games how to get better image

Unread post by hitm4n »

Vectrex is no good without some glow and persistence. I'd love to see Vectrex games in glowing glory.
User avatar
jimmystones
Core Developer
Posts: 218
Joined: Sun Nov 22, 2020 1:26 pm
Location: Reading, UK
Has thanked: 32 times
Been thanked: 251 times
Contact:

Re: Vector games how to get better image

Unread post by jimmystones »

Outputting the beam stuff is already a done thing:

https://mobile.twitter.com/ashevans81/s ... 0998275079

As to some kind of external device to make a simulated vector output that looked nice, I have no doubt someone could make a pi do that! The question would be can it be lag free enough to be fun.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Vector games how to get better image

Unread post by LamerDeluxe »

jca wrote: Thu Apr 29, 2021 10:27 pm I have been thinking about that for quite sometimes, in particular after reading on Hackaday about a project using an oscilloscope as the display. It was not done on FPGA but on a custom PCB using original components but for the part driving the scope.
The audio output of the Amiga used to be utilized for controlling laser shows. Oscilloscope music also works quite well. MiSTer would need some kind of proper DAC to be able to output to a scope, two channels for x/y and then one for brightness.
dmckean wrote: Fri Apr 30, 2021 2:22 am It would be cool if we could output the raw beam control signals to some sort of external image processor and outputs realistic looking vector graphics.
I am a bit surprised that the actual drawing of the vectors is being done by the FPGA, I wonder why that decision was made. It seems much more logical to me to output the control signals to the ARM CPU and have that draw the vectors at a better looking quality.
User avatar
jimmystones
Core Developer
Posts: 218
Joined: Sun Nov 22, 2020 1:26 pm
Location: Reading, UK
Has thanked: 32 times
Been thanked: 251 times
Contact:

Re: Vector games how to get better image

Unread post by jimmystones »

The ARM has no direct access to the display, so you'd have to pass all that video output back over to the core so it could throw it back into the scaler! Theoretically possible I think using the shared DDR RAM space but not exactly simple.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Vector games how to get better image

Unread post by LamerDeluxe »

jimmystones wrote: Fri Apr 30, 2021 9:58 am The ARM has no direct access to the display, so you'd have to pass all that video output back over to the core so it could throw it back into the scaler! Theoretically possible I think using the shared DDR RAM space but not exactly simple.
Ah, that explains it. I was thinking the scaler was running on the ARM and outputting to the display.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Vector games how to get better image

Unread post by jca »

LamerDeluxe wrote: Fri Apr 30, 2021 9:49 am The audio output of the Amiga used to be utilized for controlling laser shows. Oscilloscope music also works quite well. MiSTer would need some kind of proper DAC to be able to output to a scope, two channels for x/y and then one for brightness.
Laser show equipment wouldn't work in this case due to inertia. On MISTer it should be possible to use the User I/O port to control the scope using I2C DACs. For the Z output I do not know if the brightness is controlled or if it is just On/Off. In any case the data to drive the scope is already there as it is the values used to do the rasterization.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Vector games how to get better image

Unread post by LamerDeluxe »

jca wrote: Fri Apr 30, 2021 1:22 pm
LamerDeluxe wrote: Fri Apr 30, 2021 9:49 am The audio output of the Amiga used to be utilized for controlling laser shows. Oscilloscope music also works quite well. MiSTer would need some kind of proper DAC to be able to output to a scope, two channels for x/y and then one for brightness.
Laser show equipment wouldn't work in this case due to inertia. On MISTer it should be possible to use the User I/O port to control the scope using I2C DACs. For the Z output I do not know if the brightness is controlled or if it is just On/Off. In any case the data to drive the scope is already there as it is the values used to do the rasterization.
I know, that isn't why I mentioned it, more as one of the solutions that uses audio to control vectors. The Vectrex has variable brightness. It would also be handy for spot killing. Would be great if the User I/O solution could work.
User avatar
jimmystones
Core Developer
Posts: 218
Joined: Sun Nov 22, 2020 1:26 pm
Location: Reading, UK
Has thanked: 32 times
Been thanked: 251 times
Contact:

Re: Vector games how to get better image

Unread post by jimmystones »

Ash already did some work on this:

https://github.com/ElectronAsh/MiSTer_Vector
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Vector games how to get better image

Unread post by LamerDeluxe »

jimmystones wrote: Fri Apr 30, 2021 1:47 pm Ash already did some work on this:

https://github.com/ElectronAsh/MiSTer_Vector
Really cool, with a 3D sync option even, I suppose to sync shutter glasses with 3D Vectrex games.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Vector games how to get better image

Unread post by jca »

It looks like it is more than that as I see RGB on the board. I will have a better look at it. Thanks for the link.
Hackshed_Carl
Posts: 121
Joined: Mon May 25, 2020 3:22 pm
Has thanked: 37 times
Been thanked: 52 times
Contact:

Re: Vector games how to get better image

Unread post by Hackshed_Carl »

Take a look at the PDP-1 core. I'm pretty sure it manages to add the "glow" for spacewar but I'm not near my MiSTer currently to check
User avatar
jimmystones
Core Developer
Posts: 218
Joined: Sun Nov 22, 2020 1:26 pm
Location: Reading, UK
Has thanked: 32 times
Been thanked: 251 times
Contact:

Re: Vector games how to get better image

Unread post by jimmystones »

I think Space War is simulating a phospor coated radar screen which is a bit different, but it's possible there might be some useful techniques in there. The write-up on the PDP1 repo README is ... very involved!!
dmckean
Posts: 310
Joined: Sat Jan 16, 2021 7:03 am
Has thanked: 396 times
Been thanked: 95 times

Re: Vector games how to get better image

Unread post by dmckean »

jimmystones wrote: Fri Apr 30, 2021 9:39 am Outputting the beam stuff is already a done thing:

https://mobile.twitter.com/ashevans81/s ... 0998275079

As to some kind of external device to make a simulated vector output that looked nice, I have no doubt someone could make a pi do that! The question would be can it be lag free enough to be fun.
Interesting. I suppose it would be best if it were some sort of baremetal thing like the mt-32pi.
lnielsen
Posts: 20
Joined: Mon Jun 08, 2020 8:47 pm
Been thanked: 1 time

Re: Vector games how to get better image

Unread post by lnielsen »

I was thinking about this the other day, Could you use a small laser projector in a cabinet projecting against a screen from an old rear projection TV? I would think the smaller range would allow a lower cost projector to be used. I would love to do something like this if the cost was reasonable. My favorite vector game was Rip-Off!
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Vector games how to get better image

Unread post by jca »

A priory this seems a good idea, but...
To move the beam you need mirrors which have a non negligible mass -> Inertia.
TV screens or oscilloscopes have a phosphor coating which provides a visual persistence longer than that of your eyes.
This means that with a laser you cannot take sharp corners at full speed or they will be rounded. You have to slow down when approaching a corner and speed up when leaving it. This has 2 effects: you also have to modulate the intensity of the beam so when it slows down the intensity is not greater than the rest of the line. As you cannot go has fast as with a CRT you cannot have as many lines with the laser without flickering due to the shorter visual persistence of your eyes.
In the end you cannot use directly an existing game out of the box, it would have to be re-written to take these effects into account.
Interesting video:
https://www.youtube.com/watch?v=FkHjG759ABY
ash2fpga
Posts: 237
Joined: Tue May 26, 2020 6:20 pm
Has thanked: 62 times
Been thanked: 28 times

Re: Vector games how to get better image

Unread post by ash2fpga »

jca wrote: Tue May 18, 2021 11:40 pm Interesting video:
https://www.youtube.com/watch?v=FkHjG759ABY
Getting some flashbacks to 80s/90s laser light shows here. :D
Post Reply