3D LCD Shutter Glasses Experimentation

Published August 05, 2009
Advertisement
The Sega Master System supported 3D LCD shutter glasses to provide a more immersive (if somewhat flickery) playing experience. Having caught wind of an eBay member selling compatible glasses for $9 and being rather interested in stereoscopy I decided to experiment a little for myself.

LCD shutter glasses with adaptor
LCD shutter glasses with adaptor

The glasses are pretty simple; they consist of two LCD panels that can be "switched on" to block light from passing through to each eye. A 3.5mm stereo jack plug provides the electrical connection.

To display the 3D image you alternate between showing the image for the left eye and the right eye on the monitor, uncovering the corresponding eye immediately before the image appears on the monitor. This effectively halves the refresh rate (and results in fairly noticeable flicker when run at the standard NTSC 60Hz) and prevents the 3D glasses from working with displays that respond too slowly (eg LCD panels). I've had to dig out my old CRT monitor for this project. Even if my LCD did refresh quickly enough, its polarisation is perpendicular to the polarisation of the shutter glasses, meaning that no light can pass from the LCD through the glasses even when both eye LCD panels are switched off.

Adaptor insides
Adaptor insides

The adaptor I'm using is based on this circuit (I'm using the second variation with the variable resistor to fine-tune the driving frequency). The LCD panels require an AC voltage, and using a EOR gate as an oscillator allows the whole device to be constructed out of a single IC with a handful of external components. More importantly, being based on an existing and public design allows me to ensure that any work I do should be compatible with adaptors other people have built.

The DTR pin on the serial port supplies power to the circuit and the RTS pin is used to choose which LCD panel is switched on to cover an eye.

Test pattern seen through glasses
Test pattern seen through glasses
The above image displays a test pattern viewed through the glasses. The software alternates between clearing the screen to red with the left eye shutter open and clearing the screen to cyan with the right eye shutter open. The colours were deliberately chosen to match the colours of the common anaglyph glasses. As the colours are alternated very quickly (in the interests of avoiding a headache I used a refresh rate of 120Hz) the screen appears a light grey colour to the naked eye.

Most LCD shutter glasses appear to use some form of feedback from the video signal to synchronise the alternating of eyes. On a PC they could alternate every time the vsync signal appeared on the VGA port, on a TV they could open the correct eye shutter depending on the current field of the interlaced image that was being displayed. The Sega Master System's video chip can generate an interrupt when entering the vblank period which you can use to prepare the next frame and update the glasses. An adaptor connected to the PC's serial port has no such luck - I have not yet found a way to reliably synchronise the glasses to the refresh rate.

Poor synchronisation
Poor synchronisation (and even worse photography) results in images like the above, as seen through the left shutter. As the LCD shutters have been updated too late, some of the display intended for the right eye is seen through the left eye at the top of the display - the cyan band in this case.

So far, the best result I've had is to use Direct3DEx's DeviceEx, which provides a handy WaitForVBlank method. Less handy is the Vista requirement, as is the slight delay between returning from this function and updating the serial port, resulting in a flickering band near the top of the display as per the previous photograph. For the best results I need to set the presentation interval to "immediate", which compounds the issue with occasional tearing caused by the delay between WaitForVBlank returning and calling Present.

Switching the presentation interval back to "1" (tying the refresh rate of the render loop to that of the monitor) results in complete frames (no tearing or bands of the wrong colour/image), but the additional delay before presenting the next frame puts updating the LCD glasses out of sync by one frame. As the uncovered eye should alternate between subsequent frames one can simply uncover the "opposite" eye to uncover the correct image, but any dropped frames throw this out of sync and you get the occasional "inside out" view when the wrong eye is uncovered. Any background tasks on the PC kicking in could potentially cause a dropped frame. This is one reason that a VGA pass-through adaptor that automatically alternates the uncovered eye every frame wouldn't work, as it would get thrown out of sync by these dropped frames.

A demo compatible with the Sega 3D glasses
A demo compatible with the Sega 3D glasses, showing the images for each eye as stereo pair
The advantage of using an existing adaptor design makes me reluctant to pursue solutions that involve additional hardware to fix the problem. One possible solution I can think of would be an additional pass-through box that contains a simple latch that is clocked by the VGA vsync signal between the serial port and the glasses adaptor. You could then set the state of the glasses immediately before calling Present, safe in the knowledge that your signal will only get through to the adaptor box perfectly synchronised with the CRT's vertical refresh, assuming the CRT doesn't enter vblank between updating the serial port and calling Present. Not having to manually synchronise to vsync in software would remove the need for the Vista-only Direct3DEx too.
0 likes 5 comments

Comments

LachlanL
Very cool stuff! [smile]
August 05, 2009 07:31 PM
benryves
Cheers [smile]

I've been attempting to find some way of using interlaced video, but ATi's drivers only let you enable interlaced modes on LCDs, not CRTs. My thought was that if I used an interlaced video mode, I could output an image with data for the left eye on odd scanlines and data for the right eye on even scanlines. There'd be no synchronisation issues as it would be guaranteed that the video card would alternate between eyes on every vsync, even if you left a static image on the display.

Unfortunately, if you set interlaced timing with PowerStrip the video card still outputs progressive scan data, resulting in only the top half of the image being shown. If I set my LCD to an interlaced mode and then clone the display to the CRT then I do get true interlaced video on the CRT, but the LCD displays an error message and makes a distressing noise as it can't handle interlaced video.
August 07, 2009 05:55 AM
Matias Goldberg
Only $9? wow I thought they were expensive. Surely there are probably better glasses that isolates light entrance better for more money, but still it's $9

120Hz refresh rate? Either you have a very good CRT, or you're running at 640x480x120hz, because most standard CRTs can only handle such high frequency at those resolutions.
Well, I guess that may make the game faster, helping with the sync.
August 07, 2009 10:51 PM
benryves
Quote:Original post by Matias Goldberg
Only $9? wow I thought they were expensive. Surely there are probably better glasses that isolates light entrance better for more money, but still it's $9
My thoughts exactly! eBay is useful for that sort of thing.
Quote:120Hz refresh rate? Either you have a very good CRT, or you're running at 640x480x120hz, because most standard CRTs can only handle such high frequency at those resolutions.
Well, I guess that may make the game faster, helping with the sync.
Not a good CRT, just an old 17" hp job, so it is indeed 640×480 - but as I'm aiming to use this with the 3D games in a Sega Master System emulator I only have to support a maximum resolution of 256×192.
August 08, 2009 06:04 AM
Reelix
If you do the whole squinty-eyed thing, the two images form one 3D Image :)

Would you mind try and creating two GIF's in sequence for a moving 3D effect? :)
August 12, 2009 02:00 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement