• Advertisement

Archived

This topic is now archived and is closed to further replies.

Semi-Transparent textures?

This topic is 5679 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to have a .bmp with a transparent section and have the remainder of the image being semi transparent? My game is mainly 2D, but I don''t mind having to do some 3D effects over the top. (Is that possible w/o doing the 2D by 3D methods??) Failing that, is it possible to effect the gamma values in a specific irregular area? If possible I''d like to avoid the need for HW acceleration. -------------------------------------- Why run? You''''ll only die tired. --------------------------------------

Share this post


Link to post
Share on other sites
Advertisement
.TGA files have four color components to them, if you have a program that can generate them. So you could use that for your alpha texture.

If you're planning on coloring the texture using the polygon you render (with modulation) instead of using the colors in the bitmap itself, then the bitmap could be made as a grayscale, representing the alpha component. That means when you load the bitmap, the color value is (255, 255, 255) and the alpha component is (color data from bitmap).

Otherwise, for bitmaps that I need to have both color and alpha, I've thought about having the color data in one bitmap and the alpha values in another. Then when I load them, I merge the data together. It's a pain to manage the files, but if you don't have a .tga editor, then this is one possible option.

Software implementations on alpha textures is very slow. You have to be careful how you do it. It's possible, but I don't have any links demonstrating how, sorry.

I can't help you on gamma.

Good luck!


[edited by - Waverider on June 29, 2002 8:34:08 AM]

Share this post


Link to post
Share on other sites
You will find a lot of articles on the internet with ASM routines for software alpha blending (should be useful for gamma, too, but I don''t really now).

Share this post


Link to post
Share on other sites
Just making my prob a bit clearer...

I want to have a shadow picuture that darkens the picture below it. So if I have a big tree, casting a big shadow, you can still tell what kind of ground is below the shadow, while still having a convincing shadow.

If I can''t do this easily, then the SW mode will probably have to suffer dithered black (or dark grey) and transparent dots. The problem here is that it will look awful.

--------------------------------------
Why run? You''''ll only die tired.
--------------------------------------

Share this post


Link to post
Share on other sites
C''mon guys... ideas?

If you''re all stumped for a SW solution, then I''ll accept a best shot at a HW solution.

--------------------------------------
Why run? You''''ll only die tired.
--------------------------------------

Share this post


Link to post
Share on other sites
Search for something called ''lightmapping'' or ''lightmaps''. It sounds to me like thats what you are trying to do.

Moe''s site

Share this post


Link to post
Share on other sites
quote:
Original post by AcidBoot
Is it possible to have a .bmp with a transparent section and have the remainder of the image being semi transparent?

My game is mainly 2D, but I don''t mind having to do some 3D effects over the top. (Is that possible w/o doing the 2D by 3D methods??)

Failing that, is it possible to effect the gamma values in a specific irregular area?

If possible I''d like to avoid the need for HW acceleration.

--------------------------------------
Why run? You''ll only die tired.
--------------------------------------


If your not using a 3D api for your game your limited to what''s called "Software alpha blending". This is extremly slow, so you want to use it as little as possible, and you never want to have large areas which are being alpha blended I.E. your whole screen. The best solution (in 2d) is to make another tile/set which is the darkened version that you want. If your using a 3d api you could use the alpha channels of your textures to provide the functionality you wish or you could look into light maps.

Share this post


Link to post
Share on other sites

  • Advertisement