• Announcements

Archived

This topic is now archived and is closed to further replies.

blending problems...

Recommended Posts

I have a problem with blending. I''m not sure what I''m doing wrong. When I use the following states:
  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. 

Share on other sites
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

Share on other sites
I didn''t put it in the code sample above, I thought it''s kinda obvious Thanks, though.

Any other ideas?

Share on other sites
Try
  pDevice -> SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);

Z.

Share on other sites
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-

• Partner Spotlight

• Forum Statistics

• Total Topics
627657
• Total Posts
2978471

• 10
• 12
• 22
• 13
• 33