Transparancy in DirectX8
I know there is a way to make a color of a texture transparent
but is there any way to make a color of a surface transparent?
I have two surfaces one overlaid on the other and I would like the program to have areas of the overlaid surface to be transparent.
I am using:
g_hResult = D3DXLoadSurfaceFromFile(g_pBitmapSurface, NULL, NULL, "image.bmp", NULL, D3DX_DEFAULT, 0xFF000000, NULL);
The second last parameter is the color key, which is usually 0, and I thought changing it from 0 to 0xFF000000 would make the color black of the suface transparent.
Is there any enabling of transparency or setting up i have to do first?
Can any one help me, I am new to the Direct3D stuff
Not sure what you mean - it wasn't clear. Do you want to load the alpha channel from a texture? (.png for example)
I want to load the alpha channel from a surface, and the file is in BMP format. I am making a 2D tile engine, and need to make the second layer transparent. I am just copying a selected section from a surface to the backbuffer, and was wondering if it could be done without using textures.
vertex alpha is this what you wanted? You could set all the vertices of the triangles you wanted to be transparent to the same value.