I wish I could say it worked... :-/ No change.Originally Posted by Clootie
Although the previous piece of code I posted was not working at all, I just copied-pasted it from a VB example, modified it under Delphi, and quickly reposted here the VB version, oops
My code would say:
SetRenderState( D3DRS_ALPHABLENDENABLE, Ord(TRUE) );
SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE );
SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );
SetTextureStageState( 2, D3DTSS_COLOROP, D3DTOP_DISABLE );
(Implied earlier: SetRenderState( D3DRS_DIFFUSEMATERIALSOURCE, Ord(D3DMCS_COLOR1) ); )
SetRenderState( D3DRS_TEXTUREFACTOR, D3DCOLOR_RGBA(1,1,1,Round(Max(0,Alpha)*255)));
SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_CURRENT);
SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TFACTOR);
SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
SetTexture(0, nil);
DrawPrim( D3DPT_TRIANGLELIST, (...) SizeOf(TD3DLVertex), D3DFVF_LVERTEX);
(DrawPrim just being an easy shortcut to DrawPrimitive with implied SetStreamSource and calculation of the number of primitives to show.)
I don't set any material, but I think there's already one "installed" and I don't remember if I need to disable them or how to do that :roll:
Any ideas?
Bookmarks