Thema: Blending

Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

AW: Blending

  Alt 30. Mär 2017, 12:56
Ich bin alles andere als ein Profi was OpenGL oder Blending angeht aber kann mans nicht so machen?
Delphi-Quellcode:
// Nur RGB, ohne Alpha (lässt sich aber erweitern bei Bedarf)
function AdditiveBlend(A,B: Cardinal): Cardinal;
begin
  Result := Min((A and $FF) + (B and $FF), $FF) or (Min(((A shr 8) and $FF) + ((B shr 8) and $FF), $FF) shl 8) or (Min(((A shr 16) and $FF) + ((B shr 16) and $FF), $FF) shl 16);
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat