Alpha Channel with art.. Transparency
by Brian Wilmeth · in Torque Game Builder · 02/20/2006 (12:26 pm) · 2 replies
I saw this posted somewhere to make it so u can have an object where a certain color is transparent.
"
Melv
You can have a seperate alpha-channel if you use the following rules...
- The file-type must be JPG
- The base image must be RGB.
- The seperate alpha-channel image must be in the same directory as the base image.
- You name the alpha-channel with the same filename but append ".alpha.jpg".
Therefore, you would use the following filename format...
"mySprite.jpg" - Base RGB Image
"mySprite.alpha.jpg" - Seperate Alpha Image
This is a core-engine capability and the resultant images can be used anywhere.
EDIT: You can see this code in "gTexManager.cc" (Line 1286).
- Melv.
Edited on Nov 13, 2005 05:45
"
I followed all these rules yet I still see the white around my object. I used Paint to make the object.
My datablock is as follows
datablock t2dImageMapdatablock(spikeImageMap)
{
imageName = "~/data/Images/spike";
imageMode = full;
};
I also tried
datablock t2dImageMapdatablock(spikeImageMap)
{
imageName = "~/data/Images/spike";
imageMode = key;
};
none of these work, I still get an annoying square color surrounding my object.
Anyone know what to do?
"
Melv
You can have a seperate alpha-channel if you use the following rules...
- The file-type must be JPG
- The base image must be RGB.
- The seperate alpha-channel image must be in the same directory as the base image.
- You name the alpha-channel with the same filename but append ".alpha.jpg".
Therefore, you would use the following filename format...
"mySprite.jpg" - Base RGB Image
"mySprite.alpha.jpg" - Seperate Alpha Image
This is a core-engine capability and the resultant images can be used anywhere.
EDIT: You can see this code in "gTexManager.cc" (Line 1286).
- Melv.
Edited on Nov 13, 2005 05:45
"
I followed all these rules yet I still see the white around my object. I used Paint to make the object.
My datablock is as follows
datablock t2dImageMapdatablock(spikeImageMap)
{
imageName = "~/data/Images/spike";
imageMode = full;
};
I also tried
datablock t2dImageMapdatablock(spikeImageMap)
{
imageName = "~/data/Images/spike";
imageMode = key;
};
none of these work, I still get an annoying square color surrounding my object.
Anyone know what to do?
About the author
Torque Owner Jacob Wagner