Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have successfully connected my microcontroller to my TV via through VGA adapter i made that convert digital to analog signals with the help of resistors.

Currently i am utilizing 8 pins that I am using as 2 Red 2 Green 2 Blue 1 Hsyn and 1 Vsyn. I was thinking if there is a way to add 'A' Alpha in it, it's used for transparency. My another question is that is Alpha software driven or is it in the hardware?

Apparently, i did not find any relevant resources on hardware side of RGBA. I did notice Gameduino has used it in their 16-bit microcontroller. Is it possible to use multiplexing/charlieplexing in this problem?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Yes your going to need to support your Alpha channel in software. If you have 3 bytes for RGB you will need an extra Alpha byte to represent the transparency of the pixel in your source images.

The blending comes in to play when you composite all the layers on top of one another.

To blend you will need a screen size buffer in memory that you copy each object on to.

You didn't mention what language your using but if it is C you can convert your alpha to a percentage that you can use to blend with

float alpha = pixel.alpha / 255;
buffer[offset_dst].R += pixel[offset_src].R * alpha;
buffer[offset_dst].G += pixel[offset_src].G * alpha;
buffer[offset_dst].B += pixel[offset_src].B * alpha;

Obviously that code is for illustration only, you will quickly saturate your buffers pixels with a few layers using this. Note you don't need an Alpha channel in the buffer.

Anyway once you have drawn all your elements to the buffer send the buffer to your TV.

share|improve this answer
    
I wonder if there is a way to support in in hardware? Does vendors have it built in into the hardware or its always been software? Just a thought, is multiplexing is a way to go? And i am using Assembly but i guess it will probably be more easier to work in C. I choose Assembly just because i could squeeze a bit more power out of it. Legitimately, i will be putting up some animations as a demo so we'll see. THANKS! –  AceofSpades Apr 18 '13 at 9:24
1  
Alpha blending can be done 'in hardware' by a powerful OpenGL or Direct3D graphics card. It involves a lot of copying of things and large buffers. It is supported by 3D capable graphics cards as they are already doing most of the steps involved in alpha blending. If it is to be done in hardware it has to take place before the signal is sent over the wire I would assume. In short even a graphics card that supports alpha blending still sends an RGB signal to the monitor, not an RGBA one. –  Will Apr 18 '13 at 9:35
1  
As for the C verses Assembler debate. I think, if you are starting out, Assembler will give you a very good deep understanding of how hardware works ( something missing from more day to day software developers these days ). Most developers of higher level languages I know would not understand bit level logic, masks and so on. I moved towards and learned C when the Assembler became to hard to manage ( and that is quickly ) - Compilers are so good these days that you will have little performance advantage hand coding in Assembler and as a bonus most compilers allow inline assembler code. –  dave.zap Apr 18 '13 at 9:43
    
The lines between what is software and what is hardware are more blurred these days ( Google FPGA ). At any rate I think the methods I outlined are valid considering you are using custom hardware. –  dave.zap Apr 18 '13 at 9:49
1  
Yeah your hardware will not change. It's down to pure coding grunt work from here on out. –  dave.zap Apr 18 '13 at 9:56
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.