largely based on work by @rextimmy: add premultiplied alpha

This commit is contained in:
AzaezelX 2019-11-22 10:02:01 -06:00
parent c1e99364b7
commit bd21a207ef
6 changed files with 37 additions and 11 deletions

View file

@ -115,6 +115,10 @@ LangElement* ShaderFeatureHLSL::assignColor( LangElement *elem,
assign = new GenOp( "@ *= @", color, elem );
break;
case Material::PreMul:
assign = new GenOp("@.rgb = @.rgb + (@.rgb*(1.0-@.a))", color, elem, color, elem);
break;
case Material::AddAlpha:
assign = new GenOp( "@ += @ * @.a", color, elem, elem );
break;