Alpha value?

Started by
4 comments, last by Gink 18 years, 8 months ago
What exactly is an alpha value, and what is it for? Is it really important?
Advertisement
Alpha is important if you want to work with transparency. As always, Wikipedia to the rescue.
Jooleem. Get addicted.
Alpha [in graphical use] is a measure of opaqueness.

Yes, it's fairly important to understand, if not so important to actually use.
I see. Thanks. ^_^
Bear in mind that while the alpha value has historically meant 'opacity,' it's frequently abused into meaning other things - like reflectivity or brightness. At the end of the day it's just a number, and if you feed it to the parts of the system that deal with reflectivity or brightness instead of the parts of the system that deal with opacity, nothing will go "Hey, what? That's an alpha value dude, get it away from me."

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Here is some java applet I did a while ago that uses it, so you can see it in action if you want to compile it etc.


import javax.swing.*;import java.awt.*;public class BallApplet extends JApplet{    BallThread b[] = new BallThread[20];    Color array[] = new Color[20];        public BouncingBallApplet(){        for(int x=0; x < b.length; ++x){            array[x] = new Color((int)(Math.random()*250),(int)(Math.random()*255),(int)(Math.random()*255),(int)(Math.random()*255));            b[x] = new BallThread((int)(Math.random()*800),(int)(Math.random()*60));            b[x].start();        }        this.setSize(800,600);                  }        public void paint(Graphics g){        g.setColor(array[(int)(Math.random()*array.length)]);        g.fillOval(b[(int)(Math.random()*20)].xLoc,b[(int)(Math.random()*20)].yLoc,40,40);        this.repaint(40);    }        public static void main(String args[]){        new BallApplet();    }    public class BallThread extends Thread{        private int xLoc;        private int yLoc;                                public BallThread(int x, int y){            xLoc = x;            yLoc = y;        }                public void run(){            for(;;){                xLoc = (int)(Math.random()*800);                yLoc = (int)(Math.random()*600);                                try{                    this.sleep((long)(Math.random()*200));                }catch(InterruptedException e){                    System.out.println(e.toString());                }                            }        }    }}

This topic is closed to new replies.

Advertisement