Image Map Image Map
Page 1 of 4 1234 LastLast
Results 1 to 10 of 37

Thread: Was CGA mode 5 secretly intended for anaglyph 3D?

  1. #1

    Default Was CGA mode 5 secretly intended for anaglyph 3D?

    I'm just after looking at the CGA specs, and it struck me how the undocumented mode 5 has, besides black and white, exactly the colours you'd need for anaglyph 3D with those cheap filter glasses. Was this intentionally done or just a happy little accident?

    Was mode 5 ever used this way? Is there any software for this? Even just a simple image viewer that can load and display images in mode 5? Does anyone know?

  2. #2
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    35,381
    Blog Entries
    18

    Default

    I don't believe so. Mode 5 was intended to give a better gray scale on monochrome displays and, FWIW, got rid of the awful magenta that dominated so many CGA graphics. A little discussion.

  3. #3

    Default

    I'm not convinced about the monochrome displays argument. It would make sense given that mode 5 is implemented by setting the +BW bit in the mode register, but for the fact that in the first versions of the CGA (before the composite output was tweaked to give different shades of grey on a monochrome display) red and magenta would have displayed identically. If you have a monochrome display connected to the RGBI output, then it's up to the monitor to decide which shade of grey to display for each of the 16 RGBI bit patterns. So it could have been done to give a better grey scale if there was an existing monochrome monitor with TTL input where black/cyan/red/white was a better grey scale than black/cyan/magenta/white (or in anticipation of such a monitor). I think it's equally likely that there were some spare gates and someone thought "we can have more possible palettes if we connect this up to here". Or possibly for testing purposes (to give a visual indication of the state of the +BW bit if you didn't have a composite monitor).

    The anaglyph 3D idea is a nice one but I doubt that is what the CGA's designers had in mind. I don't think it would have worked very well with so few colours (at least my own experiments back in the day never gave a convincing effect). I suppose it's possible that they modified the circuit to try it out, found the same thing that I did, and then left the modification in place.

  4. #4
    Join Date
    Sep 2020
    Location
    Wellington, New Zealand
    Posts
    42

    Default

    The alternate cyan/red/white palette is controlled by using the BW bit to select either the COLOR SEL bit (normal behaviour) or the C0 bit of the current pixel (when BW is set). The logic gates that do this are in U22, which is a 'LS51. This chip is a 3-input AND-OR-INVERT gate, and it comes with a "bonus" 2-input AND-OR-INVERT gate on the extra pins.

    The CGA uses four 3-input AOI gates (U22, U27, U47, and U4. Strangely, U27 and U47 are both configured as a 2-input AOI gate by tying one pair of inputs high. Three of the four bonus 2-input AOI gates (U27, U47, and U4 are used to do fairly straightforward stuff.

    So it looks like the design required two 3-input AOI gates and five 2-input AOI gates, and that the bonus 2-input AOI gate on U22 was indeed a spare gate.

    I'm sure that the designers of the CGA were aware that its palettes were both limited and ugly, and figured this was a brilliant way to hack an extra colour selection into the adapter. It probably happened late in the design process.

  5. #5

    Default

    O HAI reengine, good to see you here. I'm not sure we've talked before, but you're just the man I've been meaning to contact sometime.
    If you find the time, would you have a look at my effortpost in this other thread and maybe tell me what you think? Especially on whether any of my crazy ideas would be feasible?

    Quote Originally Posted by reenigne View Post
    The anaglyph 3D idea (...) I don't think it would have worked very well with so few colours (at least my own experiments back in the day never gave a convincing effect). I suppose it's possible that they modified the circuit to try it out, found the same thing that I did, and then left the modification in place.
    Oh. Not even for simple wireframe vector graphics?

    Also, shouldn't checkerboard-dithered cyan and red have made filled (slightly overlapping) polygons possible?

  6. #6

    Default

    I mean, effectively in an anaglyphic setup you'd be limited to monochrome images (red and cyan being "white" in the left/right images respectively, while white is "white" in both,) which at 320x200 may be a tad limiting, but yeah, there's no reason you couldn't do it. Be interesting to try sometime, but of course I have no depth perception to speak of myself
    Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
    Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
    "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

  7. #7
    Join Date
    May 2011
    Location
    San Antonio, TX
    Posts
    371

    Default

    3D Anaglyph only works because the image not only has two differently-colored layers, but mixes those layers together, producing either yellow (in the case of red-green anaglyph) or purple (in the case of red-blue anaglyph). You can only use the Palette 0 Black-Red-Yellow-Green palette to make 3D images. With Mode 5, it's not possible to add the extra purple color you need to make true anaglyph images. (You need 5: Black, Cyan/Blue, Red, White, and Purple) You can only do that in EGA.
    Last edited by T-Squared; October 15th, 2020 at 08:07 PM.

  8. #8

    Default

    Quote Originally Posted by T-Squared View Post
    3D Anaglyph only works because the image not only has two differently-colored layers, but mixes those layers together, producing either yellow (in the case of red-green anaglyph) or purple (in the case of red-blue anaglyph). You can only use the Palette 0 Black-Red-Yellow-Green palette to make 3D images. With Mode 5, it's not possible to add the extra purple color you need to make true anaglyph images. (You need 5: Black, Cyan/Blue, Red, White, and Purple) You can only do that in EGA.
    That may be true for colour 3D anaglyph images. Once you're content with essentially effectively monochrome 3D imagery (though not exactly monochrome; perceptions differ and YMMV), then I think it should be possible to make this work. Mind you, the depth information is not encoded in different hues, it's encoded in how far apart those analogous cyan and red dots and lines are. And like I mentioned above, where they really overlap, those two colours could be checkerboard-dithered. EDIT: Or actually, maybe alternating vertical lines would be better than a checkerboard pattern, since our eyes are side by side. I haven't tried this, so I'm not quite sure which would work better.

    Or at least that's my understanding. Correct me if I'm wrong.
    Last edited by ropersonline; October 16th, 2020 at 12:25 AM.

  9. #9

    Default

    I think the resolution is probably too coarse for dithering to work as a true blending technique, but you could certainly do wireframe vector graphics or simple monochrome bitmap stuff.
    Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
    Synthesizers: Roland JX-10/SH-09/MT-32/D-50, Yamaha DX7-II/V50/TX7/TG33/FB-01, Korg MS-20 Mini/ARP Odyssey/DW-8000/X5DR, Ensoniq SQ-80, E-mu Proteus/2, Moog Satellite, Oberheim SEM
    "'Legacy code' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup

  10. #10

    Default

    Quote Originally Posted by ropersonline View Post
    Oh. Not even for simple wireframe vector graphics?

    Also, shouldn't checkerboard-dithered cyan and red have made filled (slightly overlapping) polygons possible?
    Try it and see if you like - perhaps you will be able to get better results than I did. I was pretty young at the time - my assumptions about why it didn't work (too much light from the red areas leaking through the blue lens and vice-versa) may have been nave or otherwise surmountable. I don't think I persisted with it for very long.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •