Jump to content
  • Advertisement
Sign in to follow this  
yuppies

what is an alpha map texture?

This topic is 4750 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

guys, what is an alpha map texture and how do i blend or use it to produce multi-texturing? Is it a a grayscale texture? or is it a transparent texture that only those areas u want to show have colors( like those of PNG's)? then how can i blend two textures by using it? what renderstates and texturestates do i need to set to achieve this?

Share this post


Link to post
Share on other sites
Advertisement
"Alpha" is the name given to the value that controls opacity/transparency - It doesn't strictly have a colour as such - it's sometimes displayed as being a greyscale texture (black = transparent, white = opaque), some tools will display it in the blue channel...

If I understand you correctly, you have a texture with only the alpha value(s)?

And you want to use that to blend between two other, completely seperate, textures?

I can't remember how to do that using the fixed function, but you're likely to have to do it in two passes - the first time modulating by alpha and the second time modulating by (1.0 - alpha) and adding them together on the destination surface/texture..

If you're using pixel shaders it gets a fair bit simpler, and you can just express it as the standard linear interpolation equation - A + T(B-A) [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Hi there Yuppies,
How are you doing?

The Problem
What is an alpha texture and how do you blend textures...

The Solution
Alpha texture...
this is a texture that has an alpha channel and this can be used to let you display an object through the alpha part of the texture...

Think of your alpha as a window...
If the window is clear/clean you can see objects right through it. Now if you have a slightly dirty window you can see a little less through it and so forth..
Same with textures.. you can specify how dirty the window is.

So this is what is refered to as alpha blending and can be very cool to use.
You create a texture with a alpha component and on some parts of the texture just let the alpha component be more prominent.

Example Texture with alpha channel

The black and white squares are the alpha channel.
See the different kinds of opacities?

All you to alpha blend them is set the appropriate render states.
pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

This render state being set it will use the alpha component of the texture that has been set. Also note the Alpha blending being enabled.

You then just render your solid objects first and then your alpha/transparent objects next..

I hope this helps a bit buddy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!