Skip to main content
gamedev.net
🔒 Locked

Multiply Alpha Blend?

Started by cow_in_the_well 2 replies 2k views
Original Post
cow_in_the_well
cow_in_the_well
I have a feeling taht the answer will be "NOS!", but is there a way to set up d3d alpha blending to do a multiply between src and dest? Basically, i want to do something like finalcolor = src * dest. Yes? No? Or No :(?
Kibble
Kibble
Yes, its a bit tricky though. You'll notice that some of the options for blend weights is src, and dest. so:
SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);

or if you want modulate 2x:
SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);SetRenderState(D3DRS_SRCBLEND, D3DBLEND_DESTCOLOR);
cow_in_the_well
cow_in_the_well
OH! YES! Thank you :). I didn't think to try sticking the srccolor into the dest blend :).

My light rendering system is working nicely now kthx.
Kibble
Kibble
No problem, this took me a long time to find out when I was looking to do some multipass modulating :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.