Add a new blend mode for sprites
This commit is contained in:
parent
6cc33553c2
commit
03282c957b
7 changed files with 34 additions and 2 deletions
|
|
@ -670,6 +670,10 @@ SSAVec4i DrawTriangleCodegen::ProcessPixel32(SSAVec4i bg, SSAInt *varying)
|
|||
fg = TranslateSample32(uvoffset);
|
||||
output = blend_revsub(shade_bgra_simple(fg, currentlight), bg, srcalpha, calc_blend_bgalpha(fg, destalpha));
|
||||
break;
|
||||
case TriBlendMode::AddSrcColorOneMinusSrcColor:
|
||||
fg = Sample32(uvoffset);
|
||||
output = blend_add_srccolor_oneminussrccolor(shade_bgra_simple(fg, currentlight), bg);
|
||||
break;
|
||||
}
|
||||
|
||||
return output;
|
||||
|
|
@ -771,6 +775,12 @@ SSAInt DrawTriangleCodegen::ProcessPixel8(SSAInt bg, SSAInt *varying)
|
|||
output = ToPal8(blend_revsub(fg, ToBgra(bg), srcalpha, calc_blend_bgalpha(fg, destalpha)));
|
||||
output = (palindex == SSAInt(0)).select(bg, output);
|
||||
break;
|
||||
case TriBlendMode::AddSrcColorOneMinusSrcColor:
|
||||
palindex = Sample8(uvoffset);
|
||||
fg = ToBgra(Shade8(palindex));
|
||||
output = ToPal8(blend_add_srccolor_oneminussrccolor(fg, ToBgra(bg)));
|
||||
output = (palindex == SSAInt(0)).select(bg, output);
|
||||
break;
|
||||
}
|
||||
|
||||
return output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue