pDevice -> SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
pDevice -> SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
[source]
My image is always shown with full opacity, regardless of the alpha value I set at the vertices.
With the following code, however,
[source]
pDevice -> SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA);
pDevice -> SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA);
[source]
The alpha blending works, only for full opacity I have to set vertices alpha to 0.0f. Another words, the alpha is 1-alpha, as it should be.
Can someone explain to me why my first example isn''t working?
Thanks.
blending problems...
I have a problem with blending. I''m not sure what I''m doing wrong.
When I use the following states:
make sure you are doing the following:
DXDisplay->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
[The views stated herein do not necessarily represent the view of the company Eurocom ]
Eurocom Entertainment Software
www.Eurocom.co.uk
The Jackal
DXDisplay->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
[The views stated herein do not necessarily represent the view of the company Eurocom ]
Eurocom Entertainment Software
www.Eurocom.co.uk
The Jackal
I didn''t put it in the code sample above, I thought it''s kinda obvious Thanks, though.
Any other ideas?
Any other ideas?
What gfx card do you have ?
Not all cards support all blending modes. Make sure you check the caps (d3dcaps8.SrcBlendCaps and d3dcaps8.DestBlendCaps I believe) before setting the blend factors.
(Although the 1st version seems the most likely to be supported)
-Morten-
Not all cards support all blending modes. Make sure you check the caps (d3dcaps8.SrcBlendCaps and d3dcaps8.DestBlendCaps I believe) before setting the blend factors.
(Although the 1st version seems the most likely to be supported)
-Morten-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement