Shop OBEX P1 Docs P2 Docs Learn Events
Future-Color-Project — Parallax Forums

Future-Color-Project

edited 2007-05-26 13:14 in Propeller 1
In This forum I will post progress I have with expirimenting with color: once I have a beta(that works) please comment. If anyone has any ideas or pointers or hints, please remind me in this topic.

P.S PM me if you want the mario project topic back, I just deleted it because it seemed that you were ignoring·the topic completely, It had been up for 3 days and without a single response, yet 136 people saw the topic.

·

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-24 15:53
    Bob,

    You shouldn’t just delete a thread after 3 days under the assumption that everyone is ignoring it. If a member has something to contribute or comment they will. But more importantly many of our members don’t have the time to sign on every day or even every three days. You should give people a chance to read the information before deciding nobody wants to comment. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • potatoheadpotatohead Posts: 10,255
    edited 2007-05-24 18:10
    Please don't ever delete a thread where somebody else has contributed something!

    (is this even possible? Hope it isn't)

    I find the idea that posts here can be deleted so long after having been posted worrysome. Makes me want to archive stuff I find useful.
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-05-24 18:33
    Hi Bob,

    I'm one of the people that looked at it, and downloaded it. Sorry I didn't comment, but I didn't know what to make of it. It appeared to be a zip with several of the files from the Hydra book CD, but without anything obvious to run. I don't know in what way this constituted a project. Now I've looked again, added the main Hydraman program and I see that what you've done is replaced the bitmap from which the sprite images are generated with a Mario themed one. I guess if you'd said that, and gave instructions for how people could run it, then you'd have got some response. As it was I imagine everyone, like me, was waiting to see if anyone else would work out what it was.

    I'm glad you're having fun with your hydra. Getting image resources in via BMP2SPIN or other means is one of those initial hurdles that you need to get over. You're obviously making good progress.

    A word of caution though. Andr
  • edited 2007-05-24 19:06
    I will fix that, just so you know the reason I don't have much work done is because I don't have a TV near my computer that I can use to test a program, nor a small VGA monitor I can use instead of rewiring my current monitor.

    Thank you.
  • potatoheadpotatohead Posts: 10,255
    edited 2007-05-24 19:50
    Yep. Just went through the no TV bit myself. I've got an old beater now, that works well.

    Was wondering about laptop capture cards. If they are not too picky, that might just be the way to go.
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-05-24 20:59
    Gosh that must be difficult. Not having a TV by the computer.

    Hey you just reminded me that I have a TV card in my computer. Haupage WinTV, about 6 oir 7 years old. I plugged the Hydra into it, set it to composite, and Bob's your uncle. That makes making snapshots a lot more convenient. Here's one.
    640 x 480 - 28K
    DK.jpg 27.5K
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-05-24 21:40
    This site: www.ntsc-tv.com/, has som interesting history about how the NTSC standard came about. It also has some diagrams and explanations of the color signal but it looks hard to understand.

    This site: cnyack.homestead.com/files/modulation/ntsc_sig.htm appears to have a clearer explanation of the signal itself, with some good pictures of what the wave form looks like.

    Awhile back I saw a post by Mahjongg (hi!) where he asked something about how the color burst is controlled for each pixel. That is a misunderstanding; the color burst is not generated for every pixel, and in fact it does not encode one pixel's color at all. Instead, it's a regular sine wave that is generated just once for every line, at a point in the wave form called the "back porch" (occuring just "behind" the H sync pulse). What the color burst actually does is it synchronizes the phase of an oscillator in the television to the phase the transmitter is using. Think of it as striking a tuning fork at the beginning of every line, so that that tuning fork will vibrate inside the TV and provide a reference for the TV to compare the incoming signal against. The hue of each pixel's color is determined by its phase; color information rides on top of the black and white picture as a high-frequency sine wave. So, the wave is going up and down for the brightness of each pixel, but on top of that, you have a smaller vibration which determines color. When the sine wave of that smaller vibration on the pixel is exactly in phase with the TV's color oscillator (the phase you told it to have with your color burst at the beginning of the line), then the color of the pixel is neutral. Changing the phase of the pixel's sine wave in relation to the phase you set up with the color burst, shifts the color to the red or blue side of the spectrum.

    The saturation of the color is determined by the amplitude of the smaller color wave superimposed on the brightness information.

    It's really quite an ingenious system. A black and white signal doesn't have any color imposed on it; so the amplitude of the color signal is then zero, meaning no saturation, no color; that's how color NTSC TV's can receive black and white signals too. Likewise, the high-frequency color signal will be smeared out by a black and white TV receiver, so a black and white TV receiving a color signal only decodes the brightness of the image. That's how they acheived compatibility with black and white TV.

    The following is just speculation: In order to get more colors than the standard setup, you must either have more ability to phase-shift (more hues) or finer control over amplitude (more grades of saturation). I think the area the Propeller graphics are weak in is saturation; I don't know if you can add another resistor to the DAC, but it might be possible to run two sets of video DAC's at once, with the second one only modifying the saturation of the first. As for phase, with two cogs that are slightly out of phase from one another, it may be possible to modify the phases slightly by relying on the timing interactions between the two cogs. That may even be possible to accomplish with standard Hydra hardware (i.e., only one DAC).

    potatohead: Beware of USB TV capture devices! They have a buffering delay of about 5 seconds between when the TV signal comes into the device and when the USB data comes out. It's a minor annoyance for watching cable TV (you change a channel, and have to wait to see the results of the change) but it makes video games unplayable. The devices are really for making your laptop into a digital video recorder; they don't warn you on the box that it cannot be used for video games. I got burned by this - I bought a Pinnacle USB TV capture device to use with my Propeller and video games, but found it unusable due to the time delay. Also, the USB capture devices rely on software to render the image. I figured it would display in something like Windows Media Player; no: it comes with it's own cheesy half-arsed media player and that is the only way you can view it. Plus, if the software is poorly written you may have to deal with crashes every time you try to use it. I could not watch more than a 30 minute cable TV show without the software locking up the computer so bad that I had to do a cold reboot. The software that came with my Pinnacle capture device was blatantly UNFINISHED. As in, they obviously took a pre-alpha build and shipped it as a finished product. As a .NET software developer (the Pinnacle software was also written in .NET) I recognized instances all throughout the software where they had dropped Windows Forms controls onto the form, and never got around to wiring up the control to have real functionality - the control still contained the default "dummy" data. Right in the channel menu there were tree-views containing "XYZ...ABC...XYZ" and so on filling the whole tree view (dummy data) and the tree view contained no actual data and did not function. Also, although the hardware supported both a cable TV F-connector (i.e. channel 3, 4, 5, and so on) and RCA-jack audio/video input, only the A/V inputs could be used with the media player! The channel selection menu allowed you to tune in stations on the F-connector input, and you could watch them in the tiny preview menu on the channel selection window. But if you tried to view them in the full-size media player, the channels would be grayed out and even though they are there, the player would not let you select them!!

    Thank goodness I was able to return the device to Best Buy. I've since ordered a different type of TV input device from Newegg.com. What I ordered this time is a simple TV to VGA converter box. What that does is it allows me to take a TV signal on one side and display it on my computer monitor directly, without going through my PC or laptop at all (your computer does not have to be turned on). Since the device does not rely on software on my computer, I do not have to deal with crappy software crashing. I am assuming the device has little or no internal memory, so there should not be any time delay due to buffering, and that will make it useful for video games. It doesn't buffer or capture the signal, just displays it. I haven't received the device yet (still in shipping) but I'll let you know how it works out for me.
  • potatoheadpotatohead Posts: 10,255
    edited 2007-05-24 22:34
    Nice catch on the 5 sec delay!

    I'm really glad you posted, because that's what I was thinking about doing. Ideally, the PCMCIA cards don't have this latency. (If one can even get them anymore) I travel enough to make having a better setup worth it. Figured a capture card would be a better investment than a small LCD, simply because I would use it for more things.

    The first few times I did this, it was great. Hooked the demo board up, in either composite or broadcast to the hotel TV and all was really decent. I'm finding many hotels not only discourage this kind of thing, they make it tough to do. (Phillips televisions seems to require some extra IR signals to get to their video inputs) So, carrying an RF modulator and a few tools to undo tough connections is out. Better to just rig something up on the laptop and call it good. Too bad somebody does not make a laptop with LCD passthrough!
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-05-25 09:10
    LCD passthrough: I was thinking the same thing! Why can't they make the VGA port on my laptop switchable to act like a VGA input to the LCD, instead of just a VGA out from the video card?

    I'm not sure if the delay with the capture device is because the device is using USB, or if it is just a "feature" of all capture cards because they buffer. I was wondering if a PCI card in a desktop would HAVE the manadatory delay because it buffers, or NOT have it because it is fast.
  • mahjonggmahjongg Posts: 141
    edited 2007-05-25 10:55
    Dennis Ferron said...
    Awhile back I saw a post by Mahjongg (hi!) where he asked something about how the color burst is controlled for each pixel. That is a misunderstanding; the color burst is not generated for every pixel, and in fact it does not encode one pixel's color at all. Instead, it's a regular sine wave that is generated just once for every line, at a point in the wave form called the "back porch" (occuring just "behind" the H sync pulse).

    Okay, I used "color burst" as a misnomer, (in the wrong context). By "colorburst" I did not mean the real color burst on the front porch, but the color subcarrier with which the color of the video data ("group of pixels") is encoded.
    I am quite familiar with the theory of the color encoding, It was just using the wrong word for the color subcarrier.
    So i was actually trying to ask "how the color subcarrier is controlled for each pixel".

    My understanding of how it works is that a COG has an oscillator of which the phase shift of it's output signal can be changed under software control. This oscillator is set to "neutral phase shift", and is then used to generate the color burst, and later on is used to generate the color subcarrier, with varying phase shifts. It's my understanding that this hardware is able to generate sixteen different phase shifts, so sixteen different "basic colors" can be generated with it (please correct me if I'm wrong).

    What I don't exactly understand is -how- the output of the phase shift oscillator directly influences the output signal of the "D/A converter" (that is controled with "WAITVID" commands). In other words, how does the output of the phase shift oscillator end up in the video signal? Does software read out it's output and add's/subtract's
    the value that is sent out with the "WAITVID" command, or does the phase shift oscillator directly influence the "WAITVID" command somehow?

    Mahjongg.
  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-05-25 11:51
    mahjongg said...
    My understanding of how it works is that a COG has an oscillator of which the phase shift of it's output signal can be changed under software control. This oscillator is set to "neutral phase shift", and is then used to generate the color burst, and later on is used to generate the color subcarrier, with varying phase shifts. It's my understanding that this hardware is able to generate sixteen different phase shifts, so sixteen different "basic colors" can be generated with it (please correct me if I'm wrong).

    You are absolutely correct. Specifically, in the TV driver software you send the color $8A as the colorburst. Which corresponds to a yellow hued black level.
    mahjongg said...
    What I don't exactly understand is -how- the output of the phase shift oscillator directly influences the output signal of the "D/A converter" (that is controled with "WAITVID" commands). In other words, how does the output of the phase shift oscillator end up in the video signal? Does software read out it's output and add's/subtract's
    the value that is sent out with the "WAITVID" command, or does the phase shift oscillator directly influence the "WAITVID" command somehow?

    It's not done with software. You give the WAITVID instruction a palette of 4 Hue/Value combinations. It's hardware in the propeller that adds the phase shifted color sub-carrier to the luma level.
  • edited 2007-05-25 14:33
    Thanks for the nice information! I'm suprised how well my topic is doing!

    BTW. Can someone here post example lines of code of what each of·you guys have said?

    Thank you.
  • mahjonggmahjongg Posts: 141
    edited 2007-05-25 14:38
    CardboardGuru said...
    It's not done with software. You give the WAITVID instruction a palette of 4 Hue/Value combinations. It's hardware in the propeller that adds the phase shifted color sub-carrier to the luma level.

    Okay, then this mechanism is what actually limits the number of hue's that can be generated, as other COG's cannot be used to "improve" the color sub-carrier generator.

    Is there a mechanism in place that can be used to change the -amplitude- of the color sub-carrier, and thereby the saturation of the hue?

    Mahjongg.
  • LawsonLawson Posts: 870
    edited 2007-05-25 15:24
    Ah computer TV capture devices. I know thou well! I've had some struggles myself with them. First thing I learned was, to look for Open source software that does what you want THEN find a device supported by said software and buy that device. The Haupage WinTV is a good choice for a PCI card if you don't do much recording. It's BT8x8 based and supported by nearly every piece of 3rd party software I found. More sophisticated TV cards have a built in MPEG2 encoder for background recording of TV, but this introduces about a one second delay. My first TV card was a ATI TV wonder. God, that card's driver didn't just have a few bugs, it had a whole HIVE of bugs! In my current TV card, it's a cheap one, the MPEG2 encoder is always on. If you can find a PCMCIA TV card based on a BT8x8 chip you'll be golden for games.

    Haven't played too much with USB TV devices. my advice would be to get the cheapest no-frills USB2.0 device you can find. USB2.0 speed plus cheap make it likely that no or trivial compression and buffering is happening for a minimum amount of lag. (this => http://www.mythtv.org/docs/mythtv-HOWTO-3.html#ss3.1 section of the MythTV docs gives a good start for a search on more info)

    and now back to the regularly scheduled topic,
    Marty
  • potatoheadpotatohead Posts: 10,255
    edited 2007-05-25 15:48
    Wouldn't it be possible to get more than 16 hues by packing more than one propeller waitvid pixel into an NTSC color cycle (clock)?
  • edited 2007-05-25 20:22
    ·Potatohead, I did that with the NTSC driver and..well, all the colors were tinted differently.
    I·told it to hue·32 times·by doing just what you said.

    BTW: I like potatoes, I think the Hydra should be shaped like one. lol.gif
  • edited 2007-05-25 20:32
    Progress!:·I have an animation I'll use on the Hydra with the driver ^_^;

    Looky looky! freaked.gif

    I'll have the driver hue this image during animation in a loop so it goes through every color!

    :NOTE: Right now it's a GIF but I'll seperate them later.
    Cool?
    ······················· ·scool.gif

    Post Edited (Bob the Builder on a C64) : 5/25/2007 8:58:15 PM GMT
    330 x 250 - 2M
  • AndreLAndreL Posts: 1,004
    edited 2007-05-25 22:08
    Wow, now that's cool! What technique is this, using the triangle draw function? Or is it compressed bitmaps? Or tile animation?

    Andre'
  • edited 2007-05-26 01:26
    Really, I just drew it with MSPAINT and used a GIF. When I use it on the Hydra I'll make it a bit smaller and take up less memory for this animation, then I'll tell it to cycle through in just as in this GIF, but as it does it, I'll have it hue the color of the ship constantly. Sound good?·· confused.gif· burger.gif
  • AndreLAndreL Posts: 1,004
    edited 2007-05-26 04:44
    So that's not on the hydra? You just drew pics and then made an animated gif? I thought that was a demo runnning on the hardware.

    Ahhh.

    Andre'
  • edited 2007-05-26 13:14
    It's not running on the Hydra YET, but it fits the 256 color pallete luckilly! [noparse]:D[/noparse]
Sign In or Register to comment.