Jump to content
  • Advertisement
Coelancanth

DX11 DX11 Alpha Blending calculating

This topic is 418 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

Hi guys,

this is a exam question regarding alpha blending, however there is no official solution, so i am wondering  whether my solution is right or not... thanks in advance...

photo_2017-07-27_11-16-46.thumb.jpg.eccb3c446866bc7675f8f95a9cacf198.jpg

my idea:

BS1:

since BS1 with BlendEnable set as false, just write value into back buffer.

-A : (0.4, 0.4, 0.0, 0.5)

-B : (0.2, 0.4, 0.8, 0.5)

 

BS2:

 

backbuffer.RGB: = (0.4, 0.0, 0.0) * 1 + (0.0, 0.0, 0.0) * (1-0.5)      = ( 0.4, 0.0, 0.0)

backbuffer.Alpha = 1*1 + 0*0   =1

 

A.RGB = (0.4, 0.4, 0.0)* 0.5 + (0.4, 0.0, 0.0)* ( 1-0.5)   = (0.4,0.2,0.0)

A.Alpha=0.5*1+1*(1-0.5) = 1

 

 

B.RGB = (0.2, 0.4, 0.8) * 0.5 + (0.4, 0.2, 0.0) * (1-0.5)  = (0.3, 0.3, 0.4)

B.Alpha = 0.5 * 1 + 1*(1-0.5)  = 1

 

==========================

BS3:

 

backbuffer.RGB = (0.4, 0.0, 0.0) + (0.0, 0.0, 0.0)  = (0.4, 0.0, 0.0)

backbuffer.Alpha = 0

 

A.RGB = (0.4, 0.4, 0.0) + (0.4, 0.0, 0.0) = (0.8, 0.4, 0.0)

A.Alpha = 0

 

B.RGB = (0.2, 0.4, 0.8) + (0.8, 0.4, 0.0) = (1.0, 0.8, 0.8)

B.Alpha = 0

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!