Skip to content

Commit

Permalink
Add ColorDodge blendmodes
Browse files Browse the repository at this point in the history
  • Loading branch information
pixtur committed Jun 11, 2023
1 parent 06514f9 commit e714456
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Core/Utils/SharedEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public enum RgbBlendModes
Difference = 4,
UseImageA_RGB = 5,
UseImageB_RGB = 6,
ColorDodge = 7,
LinearDodge = 8,
}
}
}
10 changes: 10 additions & 0 deletions Resources/lib/shared/blend-functions.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ float4 BlendColors(float4 tA, float4 tB, int blendMode)
case 6:
rgb = tB.rgb;
break;

// colorDodge
case 7:
rgb = tA.rgb / (1.0001 - saturate( tB.rgb));
break;

// linearDodge
case 8:
rgb = tA.rgb + tB.rgb;
break;
}

return float4(rgb, a);
Expand Down

0 comments on commit e714456

Please sign in to comment.