alphablending - Implementing Porter-Duff Rules in Direct3D -
what direct3d render states should used implement java's porter-duff compositing rules (clear, src, srcover, etc.)?
i'm haven't used java much, based on white paper 1984, should straightforward mapping of render state blend modes.
there of course more can these, normal alpha blending (sourcealpha, invsourcealpha) or additive (one, one) name few. (i assume asking these because porting existing functionality? in cause may not care other combinations...)
anyway, these assume blendoperation of add , alphablendenable true.
clear
sourceblend = 0 destinationblend = 0
a
sourceblend = 1 destinationblend = 0
b
sourceblend = 0 destinationblend = 1
a on b
sourceblend = 1 destinationblend = invsourcealpha
b on a
sourceblend = invdestinationalpha destinationblend = 1
a in b
sourceblend = destinationalpha destinationblend = 1
b in a
sourceblend = 0 destinationblend = sourcealpha
a out b
sourceblend = invdestinationalpha destinationblend = 0
b out a
sourceblend = 0 destinationblend = invsourcealpha
a atop b
sourceblend = destinationalpha destinationblend = invsourcealpha
b atop a
sourceblend = invdestinationalpha destinationblend = sourcealpha
a xor b
sourceblend = invdestinationalpha destinationblend = invsourcealpha
chaining these little more complex , require either multiple passes or multiple texture inputs shader.
Comments
Post a Comment