• Advertisement

Archived

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

DESTBLEND what exactly is it?

This topic is 6658 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

what is DESTBLEND? I thought it was only of the current material, so i was really surprised (not to mention delighted ) when d3d actually produced transparent walls, etc. How do i manipulate/set DESTBLEND actual values (i don't mean setting the render state)? i can't quite control transparency without it... Also, is it adviseable to use more than one d3d device at the same time (HAL and RGB, ex)?

Share this post


Link to post
Share on other sites
Advertisement
If alpha blending is enabled (D3DRENDERSTATE_ALPHABLENDENABLE == TRUE) the output color is computed using the following formula:

FinalColor = Texel*SourceBlendFactor + Pixel*DestBlendFactor

You can set source blend and dest blend with the D3DRENDERSTATE_SRCBLEND and D3DRENDERSTATE_DESTBLEND, respectively. Possible values (not supported on all hardware) include 0, 1, src color, dest color, inverse src color, inverse dest color, src alpha, dest alpha, inverse src alpha, inverse dest alpha, and a couple others. (Check out the D3DBLEND enumerated type in the D3D Reference section)

If you wanted to emulate modulate, you can set dest blend to src color, and src blend to 0. For modulate 2x, dest blend to src color, and src blend to dest color. Add is just dest and src blend to 1.

Translucency can usually done with dest blend = inv src alpha, and src blend = src alpha. For this to have any real meaning, you should be using 4444 or 8888 texture formats, which contain translucency information.

Using multiple D3D devices has no penalty in DX6 and earlier. There is a performance hit in using multiple devices in DX7.

Share this post


Link to post
Share on other sites

  • Advertisement