Hi!
Hope this is the right place to post...
I am very new to this whole DirectX stuff.
I want to draw a sprite which is slightly transparent. I read in the documentation that one can change the alpha and color channels of a sprite directly when using ID3DXSprite::Draw. The last Parameter of this function should do this work for me.
With the color channels it works fine but when changing the alpha value (for example: 7FFFFFFFh instead of FFFFFFFFh) nothing happens and the picture/sprite is still completely opaque.
I tried to search the forum first but found nothing that helped me.
thx for any help
Hope this is the right place to post...
I am very new to this whole DirectX stuff.
I want to draw a sprite which is slightly transparent. I read in the documentation that one can change the alpha and color channels of a sprite directly when using ID3DXSprite::Draw. The last Parameter of this function should do this work for me.
With the color channels it works fine but when changing the alpha value (for example: 7FFFFFFFh instead of FFFFFFFFh) nothing happens and the picture/sprite is still completely opaque.
I tried to search the forum first but found nothing that helped me.
thx for any help
Hi!
Hope this is the right place to post...
I am very new to this whole DirectX stuff.
I want to draw a sprite which is slightly transparent. I read in the documentation that one can change the alpha and color channels of a sprite directly when using ID3DXSprite::Draw. The last Parameter of this function should do this work for me.
With the color channels it works fine but when changing the alpha value (for example: 7FFFFFFFh instead of FFFFFFFFh) nothing happens and the picture/sprite is still completely opaque.
I tried to search the forum first but found nothing that helped me.
thx for any help
What programming language are you using?
I use MASM of course ... but is this important?
You have to set-up the renderer first:
SSS macro param,val
pcall g_pd3dDevice.SetRenderState,param,val
endm
;------[ start 3D drawing ]--------\
pcall g_pd3dDevice.BeginScene ; this you've already done
SSS D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA
SSS D3DRS_SRCBLEND,D3DBLEND_SRCALPHA
SSS D3DRS_CULLMODE,D3DCULL_NONE
SSS D3DRS_ZENABLE,0
SSS D3DRS_ALPHABLENDENABLE,1
SSS D3DRS_SHADEMODE,1 ; flat
SSS D3DRS_ZWRITEENABLE,0
SSS D3DRS_LIGHTING,0
thanx ... I already tried with the SetRenderState but did not know that so much Parameters must be changed ... but now it works