Thread: [Algorithms] Alpha Channel
Brought to you by:
vexxed72
From: Pai-Hung C. <pa...@ac...> - 2000-08-26 20:14:52
|
Hi, I want to use billboard in my program but cannot find a good way to create 32-bit bitmap with alpha channel of appropriate values. Basically I want to create a bitmap of tree with leaves in various green colors (with alpha = 255) and all non-green colors transparent (alpha = 0) so that I can use it as the texture for my billboarded trees. It would be nice if I can specify a non-green color C and make the alpha of all the pixels of color C in the bitmap to 0. Is there any program capable of doing that with 32-bit bitmap with alpha channel? This may be off-topic and you could send your advise to me off-line. Thanks in advance, Pai-Hung Chen |
From: gl <gl...@nt...> - 2000-08-26 21:48:58
|
Take a look at the 'D3DFrame' texture loader code (part of the SDK) - it does exactly that from alpha files. If you can use 16bit, choose the 5551 format if available, as 1 bit of alpha is all you need. BTW, you are really describing colour keying, but don't use it, as it's legacy and can cause all kinds of problems when combined with alpha blending (search the archives for details). -- gl ----- Original Message ----- From: "Pai-Hung Chen" <pa...@ac...> To: <gda...@li...> Sent: Saturday, August 26, 2000 9:08 PM Subject: [Algorithms] Alpha Channel > Hi, > > I want to use billboard in my program but cannot find a good way to create > 32-bit bitmap with alpha channel of appropriate values. Basically I want to > create a bitmap of tree with leaves in various green colors (with alpha = > 255) and all non-green colors transparent (alpha = 0) so that I can use it > as the texture for my billboarded trees. It would be nice if I can specify > a non-green color C and make the alpha of all the pixels of color C in the > bitmap to 0. Is there any program capable of doing that with 32-bit bitmap > with alpha channel? This may be off-topic and you could send your advise to > me off-line. > > Thanks in advance, > > Pai-Hung Chen > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Pai-Hung C. <pa...@ac...> - 2000-08-26 21:57:36
|
Thanks for the help. Actually I am looking for a graphics package that allow me to pre-process (e.g. color-keying) the alpha info into the bitmap, so that I can use it directly as alpha-translucent billboard in my program. Pai-Hung Chen ----- Original Message ----- From: gl <gl...@nt...> To: <gda...@li...> Sent: Saturday, August 26, 2000 2:48 PM Subject: Re: [Algorithms] Alpha Channel > > Take a look at the 'D3DFrame' texture loader code (part of the SDK) - it > does exactly that from alpha files. > > If you can use 16bit, choose the 5551 format if available, as 1 bit of alpha > is all you need. BTW, you are really describing colour keying, but don't > use it, as it's legacy and can cause all kinds of problems when combined > with alpha blending (search the archives for details). > -- > gl > > ----- Original Message ----- > From: "Pai-Hung Chen" <pa...@ac...> > To: <gda...@li...> > Sent: Saturday, August 26, 2000 9:08 PM > Subject: [Algorithms] Alpha Channel > > > > Hi, > > > > I want to use billboard in my program but cannot find a good way to create > > 32-bit bitmap with alpha channel of appropriate values. Basically I want > to > > create a bitmap of tree with leaves in various green colors (with alpha = > > 255) and all non-green colors transparent (alpha = 0) so that I can use it > > as the texture for my billboarded trees. It would be nice if I can > specify > > a non-green color C and make the alpha of all the pixels of color C in the > > bitmap to 0. Is there any program capable of doing that with 32-bit > bitmap > > with alpha channel? This may be off-topic and you could send your advise > to > > me off-line. > > > > Thanks in advance, > > > > Pai-Hung Chen > > > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > |
From: Joe B. <jb...@av...> - 2000-08-26 22:27:56
|
There isn't anything our artists can't do with Adobe Photoshop. > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On Behalf Of > Pai-Hung Chen > Sent: Saturday, August 26, 2000 3:51 PM > To: gda...@li... > Subject: Re: [Algorithms] Alpha Channel > > > Thanks for the help. Actually I am looking for a graphics package that > allow me to pre-process (e.g. color-keying) the alpha info into > the bitmap, > so that I can use it directly as alpha-translucent billboard in > my program. > > Pai-Hung Chen |
From: Scott J. S. <sjs...@um...> - 2000-08-26 23:50:52
|
A bit OT, but oh well: The 5551 format is not available in D3D. Only the 1555 format (alpha in the high bit) is. This is equivalent to the OpenGL 1_5_5_5_REV packed pixel format exposed in OpenGL 1.2. Direct3D only exposes the REV packed pixel formats (they don't call them reversed, of course), while OpenGL prefers the regular formats but does expose the REV formats in 1.2. You have to be very careful that you understand the formats correctly. The packed formats look the same on all machine architectures (i.e., 1_5_5_5_REV always has the alpha in the high bit), but OpenGL formats like GL_UNSIGNED_BYTE - GL_RGBA have components in different places depending on the endianness of the host machine. Even more OT: Color keying can actually be a win if you have a lot of 2d code interspersed with 3d code. Because of texture limitations, if you have a 2d-windowing system that need to run in a 3d window you'll probably end up compositing it in system memory, than slicing it into small tiles, each which is uploaded as a texture. On the other hand, you can probably do a 2d blt to the render target on most D3D hardware for 2d stuff, and this is far faster. (By way of comparison, the software driver at my employer runs the 2d stuff 3x faster than a Geforce2 without doing 2d blits). -- Scott Shumaker sjs...@um... On Sat, 26 Aug 2000, gl wrote: > > Take a look at the 'D3DFrame' texture loader code (part of the SDK) - it > does exactly that from alpha files. > > If you can use 16bit, choose the 5551 format if available, as 1 bit of alpha > is all you need. BTW, you are really describing colour keying, but don't > use it, as it's legacy and can cause all kinds of problems when combined > with alpha blending (search the archives for details). > -- > gl > > ----- Original Message ----- > From: "Pai-Hung Chen" <pa...@ac...> > To: <gda...@li...> > Sent: Saturday, August 26, 2000 9:08 PM > Subject: [Algorithms] Alpha Channel > > > > Hi, > > > > I want to use billboard in my program but cannot find a good way to create > > 32-bit bitmap with alpha channel of appropriate values. Basically I want > to > > create a bitmap of tree with leaves in various green colors (with alpha = > > 255) and all non-green colors transparent (alpha = 0) so that I can use it > > as the texture for my billboarded trees. It would be nice if I can > specify > > a non-green color C and make the alpha of all the pixels of color C in the > > bitmap to 0. Is there any program capable of doing that with 32-bit > bitmap > > with alpha channel? This may be off-topic and you could send your advise > to > > me off-line. > > > > Thanks in advance, > > > > Pai-Hung Chen > > > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: gl <gl...@nt...> - 2000-08-27 00:30:07
|
Yes, I did mean 1555. Neurons misfiring... -- gl ----- Original Message ----- From: "Scott Justin Shumaker" <sjs...@um...> To: <gda...@li...> Sent: Sunday, August 27, 2000 12:50 AM Subject: Re: [Algorithms] Alpha Channel > A bit OT, but oh well: > The 5551 format is not available in D3D. Only the 1555 format (alpha in > the high bit) is. This is equivalent to the OpenGL 1_5_5_5_REV packed > pixel format exposed in OpenGL 1.2. > > Direct3D only exposes the REV packed pixel formats (they don't call them > reversed, of course), while OpenGL prefers the regular formats but does > expose the REV formats in 1.2. > > You have to be very careful that you understand the formats correctly. > The packed formats look the same on all machine architectures (i.e., > 1_5_5_5_REV always has the alpha in the high bit), but OpenGL formats like > GL_UNSIGNED_BYTE - GL_RGBA have components in different places depending > on the endianness of the host machine. > > Even more OT: > > Color keying can actually be a win if you have a lot of 2d code > interspersed with 3d code. Because of texture limitations, if you have a > 2d-windowing system that need to run in a 3d window you'll probably end up > compositing it in system memory, than slicing it into small tiles, each > which is uploaded as a texture. On the other hand, you can probably do a > 2d blt to the render target on most D3D hardware for 2d stuff, and this is > far faster. (By way of comparison, the software driver at my employer > runs the 2d stuff 3x faster than a Geforce2 without doing 2d blits). > > -- > Scott Shumaker > sjs...@um... > > On Sat, 26 Aug 2000, gl wrote: > > > > > Take a look at the 'D3DFrame' texture loader code (part of the SDK) - it > > does exactly that from alpha files. > > > > If you can use 16bit, choose the 5551 format if available, as 1 bit of alpha > > is all you need. BTW, you are really describing colour keying, but don't > > use it, as it's legacy and can cause all kinds of problems when combined > > with alpha blending (search the archives for details). > > -- > > gl > > > > ----- Original Message ----- > > From: "Pai-Hung Chen" <pa...@ac...> > > To: <gda...@li...> > > Sent: Saturday, August 26, 2000 9:08 PM > > Subject: [Algorithms] Alpha Channel > > > > > > > Hi, > > > > > > I want to use billboard in my program but cannot find a good way to create > > > 32-bit bitmap with alpha channel of appropriate values. Basically I want > > to > > > create a bitmap of tree with leaves in various green colors (with alpha = > > > 255) and all non-green colors transparent (alpha = 0) so that I can use it > > > as the texture for my billboarded trees. It would be nice if I can > > specify > > > a non-green color C and make the alpha of all the pixels of color C in the > > > bitmap to 0. Is there any program capable of doing that with 32-bit > > bitmap > > > with alpha channel? This may be off-topic and you could send your advise > > to > > > me off-line. > > > > > > Thanks in advance, > > > > > > Pai-Hung Chen > > > > > > > > > _______________________________________________ > > > GDAlgorithms-list mailing list > > > GDA...@li... > > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Max G. <gi...@li...> - 2000-08-27 19:39:35
|
Pai-Hung Chen wrote: > Is there any program capable of doing that with 32-bit bitmap > with alpha channel? This can be done in any reasonable program like GIMP for example (available for Win also). Max -- Max Gilead (gi...@li...) http://3d.linart.krakow.pl/OfficinaArtificialis ----------------------------------------------------------------------------- -- Duck season! Rabbit season! Duck season! Rabbit season! ELMER SEASON!!! -- |
From: Stephen J B. <sj...@li...> - 2000-08-28 16:12:10
|
On Sat, 26 Aug 2000, Pai-Hung Chen wrote: > I want to use billboard in my program but cannot find a good way to create > 32-bit bitmap with alpha channel of appropriate values. Basically I want to > create a bitmap of tree with leaves in various green colors (with alpha = > 255) and all non-green colors transparent (alpha = 0) so that I can use it > as the texture for my billboarded trees. It would be nice if I can specify > a non-green color C and make the alpha of all the pixels of color C in the > bitmap to 0. Is there any program capable of doing that with 32-bit bitmap > with alpha channel? This may be off-topic and you could send your advise to > me off-line. Use GLUT Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |