DESTBLEND what exactly is it?

Started by
0 comments, last by AlexM 24 years, 5 months ago
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)?
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.

This topic is closed to new replies.

Advertisement