glBlendEquation

Aus DGL Wiki
Version vom 27. September 2005, 18:17 Uhr von Flash (Diskussion | Beiträge) ()

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche
Hinweis: Dieser Artikel ist noch unvollständig.
(Mehr Informationen/weitere Artikel)

{{{1}}}

Incomplete.jpg

glBlendEquation


Name

glBlendEquation - setzt die Blendgleichung. (siehe Blending)


Delphi-Spezifikation

procedure glBlendEquation(mode: TGLenum);


Parameter

mode Bestimmt wie Quell- und Zielfarbe miteinander kombiniert werden. Als Werte werden nur folgende symbolische Konstanten akzeptiert: GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX oder GL_MIN


Beschreibung

Die Blendgleichung bestimmt, wie neue Pixel (die "Quellfarbe") mit den Pixeln im Framebuffer (die "Zielfarbe") kombiniert werden.

GL_MIN

setzt die Blendgleichung so, dass die Farbkomponenten von Quell- und Zielfarbe jeweils einzeln miteinander verglichen werden, und der kleinere Wert wird übernommen.

GL_MAX

setzt die Blendgleichung so, dass die Farbkomponenten von Quell- und Zielfarbe jeweils einzeln miteinander verglichen werden, und der größere Wert wird übernommen.

Die restlichen Blendgleichungen benutzen die Quell- und Zielblendfaktoren die mittels glBlendFunc definiert wurden. Für nähere Erklärungen zu den Faktoren lesen Sie den Artikel glBlendFunc

In den nun nachfolgenden Gleichungen werden einige "Symbole" benutzt welche die folgenden Bedeutungen haben:

Symbol Bedeutung
(Rs, Gs, Bs, As ) und (Rd, Gd, Bd, Ad ) Die Farbkombonenten der Quellfarbe (Source) und Zielfarbe(destination).
(Rr, Gr, Br, Ar ) Die Farbkombonenten der resultierenden Farbe.
(sR, sG, sB, sA ) und (dR, dG, dB, dA ) Die Quellblendfaktoren und Zielblendfaktoren.

Für die nachfolgenden Gleichungen wird angenommen, dass die Werte im Bereich [0, 1] liegen.

      In  the  equations that follow, source and destination color components
      are referred to as (Rs, Gs, Bs, As ) and (Rd, Gd,  Bd,  Ad  ),  respec-respectively.
      tively.   The  result  color  is referred to as (Rr, Gr, Br, Ar ).  The
      source and destination blend factors are denoted (sR, sG, sB, sA )  and
      (dR,  dG, dB, dA ), respectively.  For these equations all color compo-components
      nents are understood to have values in the range [0, 1].
      GL_FUNC_ADD
             sets the blend equation so that the source and destination  data
             are  added.  Each component of the source color is multiplied by
             the corresponding source factor, then each component of the des-destination
             tination  color  is  multiplied by the corresponding destination
             factor.  The result is the componentwise sum of  the  two  prod-products,
             ucts, clamped to the range [0, 1].


                    Rr=min(1,RssR+RddR)Gr = min (1, Gs sG + Gd dG )
                    Br=min(1,BssB+BddB)Ar = min (1, As sA + Ad dA )
      GL_FUNC_SUBTRACT
             Is like GL_FUNC_ADD except the product of the destination factor
             and the destination color is componentwise subtracted  from  the
             product  of  the source factor and the source color.  The result
             is clamped to the range [0, 1].
                    Rr = max (0 , Rs sR - Rd dR )
                    Gr = max (0 , Gs sG - Gd dG )
                    Br = max (0 , Bs sB - Bd dB )
                    Ar = max (0 , As sA - Ad dA )
      GL_FUNC_REVERSE_SUBTRACT
             Is like GL_FUNC_ADD except the product of the source factor  and
             the source color is componentwise subtracted from the product of
             the destination factor and the destination color.  The result is
             clamped to the range [0, 1].
                    Rr=max(0,RddR-RssR)Gr = max (0 , Gd dG - Gs sG )
                    Br=max(0,BddB-BssB)Ar = max (0 , Ad dA - As sA )
      The  GL_MIN  and GL_MAX equations are useful for applications that ana-analyze
      lyze
      image data (image thresholding against a constant color, for  example).
      The  GL_FUNC_ADD  equation is useful for antialiasing and transparency,
      among other things.

Im Initialzustand ist die Blendgleichung auf GL_FUNC_ADD gesetzt.


Hinweise

glBlendEquation ist Teil des GL_ARB_imaging Befehlssatzes. glBlendEquation ist nur vorhanden, wenn GL_ARB_imaging in dem String enthalten ist, der von glGetString mit dem Argument GL_EXTENSIONS geliefert wird.

Die GL_MIN und GL_MAX Gleichungen nutzen nicht die Quell- und Zielfaktoren sondern nur die Quell- und Zielfarben.


Fehlermeldungen

GL_INVALID_ENUM wird generiert wenn mode nicht GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX oder GL_MIN zugeordnet wurde.
GL_INVALID_OPERATION wird generiert wenn glBlendEquation innerhalb eines glBegin-glEnd Blocks aufgerufen wird.


Zugehörige Wertrückgaben

glGet mit Token GL_BLEND_EQUATION


Siehe auch

glGetString, glBlendColor, glBlendFunc