Advertisement

DX11 Alpha Blending calculating

Started by July 27, 2017 10:55 AM
0 comments, last by Coelancanth 7 years, 6 months ago

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

 

 

 

This topic is closed to new replies.

Advertisement