Jump to content

  • Log In with Google      Sign In   
  • Create Account


DESTBLEND what exactly is it?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 AlexM   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 October 1999 - 09:52 PM

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)?

Sponsor:

#2 mhkrause   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 October 1999 - 09:52 PM

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.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS