Jump to content
  • Advertisement
Sign in to follow this  

transparence box?

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

Advertisement
You must use a vertex format like this one:

#define D3DFVF_CUSTOMVERTEX(D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_DIFFUSE)

typedef struct tagCUSTOMVERTEX{
D3DXVECTOR3 p;
D3DXVECTOR3 n;
DWORD Color;
}CUSTOMVERTEX;

you can put the color by calling the D3DCOLOR_ARGB(a, r, g, b) macro:

CUSTOMVERTEX Vertices[] =
{
//Position | Normal | Color
{-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, D3DCOLOR_ARGB(144, 255, 25, 5),},
};
by changing the value of the <<a>> param you change the transparency of the
vertex.

set the D3DRS_ALPHABLENDENABLE render state to true
set the D3DRS_SRCBLEND render state to D3DBLEND_ something (look at the SDK).
set the D3DRS_DESTBLEND render state to D3DBLEND_something(like above).

i dont know if you got it but it's prety simple
look at the DirectX SDK.

by the way i'm not so sure that thats the way.
Give it a try.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!