1GLBLENDEQUATION(3G)              OpenGL Manual             GLBLENDEQUATION(3G)
2
3
4

NAME

6       glBlendEquation - specify the equation used for both the RGB blend
7       equation and the Alpha blend equation
8

C SPECIFICATION

10       void glBlendEquation(GLenum mode);
11
12       void glBlendEquationi(GLuint buf, GLenum mode);
13

PARAMETERS

15       buf
16           for glBlendEquationi, specifies the index of the draw buffer for
17           which to set the blend equation.
18
19       mode
20           specifies how source and destination colors are combined. It must
21           be GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN,
22           GL_MAX.
23

DESCRIPTION

25       The blend equations determine how a new pixel (the ''source'' color) is
26       combined with a pixel already in the framebuffer (the ''destination''
27       color). This function sets both the RGB blend equation and the alpha
28       blend equation to a single equation.  glBlendEquationi specifies the
29       blend equation for a single draw buffer whereas glBlendEquation sets
30       the blend equation for all draw buffers.
31
32       These equations use the source and destination blend factors specified
33       by either glBlendFunc() or glBlendFuncSeparate(). See glBlendFunc() or
34       glBlendFuncSeparate() for a description of the various blend factors.
35
36       In the equations that follow, source and destination color components
37       are referred to as R s G s B s A s and R d G d B d A d, respectively.
38       The result color is referred to as R r G r B r A r. The source and
39       destination blend factors are denoted s R s G s B s A and d R d G d B d
40       A, respectively. For these equations all color components are
41       understood to have values in the range 0 1.
42
43       ┌─────────────────────────────┬───────────────────────────────────────────────────┬───────────────────────────────────────────────────┐
44       │                             │                                                   │                                                   │
45Mode RGB                       Alpha                     
46       │                             │ Components                                        Component                                         
47       │                             │                                                   │                                                   │
48       ├─────────────────────────────┼───────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
49GL_FUNC_ADD                  │ <div>                                             │ <div>                                             │
50       │                             │                                                   │                                                   │
51       │                             │                                                   │                                                   │
52       │                             │                                 Rr                │                                 Ar                │
53       │                             │                                 =                 │                                 =                 │
54       │                             │                                                   │                                                   │
55       │                             │                                     R             │                                     A             │
56       │                             │                                     s             │                                     s             │
57       │                             │                                                   │                                                   │
58       │                             │                                     ⁢             │                                     ⁢             │
59       │                             │                                     s             │                                     s             │
60       │                             │                                     R             │                                     A             │
61       │                             │                                                   │                                                   │
62       │                             │                                     +             │                                     +             │
63       │                             │                                     R             │                                     A             │
64       │                             │                                     d             │                                     d             │
65       │                             │                                                   │                                                   │
66       │                             │                                     ⁢             │                                     ⁢             │
67       │                             │                                     d             │                                     d             │
68       │                             │                                     R             │                                     A             │
69       │                             │                                                   │                                                   │
70       │                             │                                                   │                                                   │
71       │                             │                                                   │                                                   │
72       │                             │                         </div>                    │                         </div>                    │
73       │                             │                         <div>                     │                                                   │
74       │                             │                                                   │                                                   │
75       │                             │                                                   │                                                   │
76       │                             │                                 Gr                │                                                   │
77       │                             │                                 =                 │                                                   │
78       │                             │                                                   │                                                   │
79       │                             │                                     G             │                                                   │
80       │                             │                                     s             │                                                   │
81       │                             │                                                   │                                                   │
82       │                             │                                     ⁢             │                                                   │
83       │                             │                                     s             │                                                   │
84       │                             │                                     G             │                                                   │
85       │                             │                                                   │                                                   │
86       │                             │                                     +             │                                                   │
87       │                             │                                     G             │                                                   │
88       │                             │                                     d             │                                                   │
89       │                             │                                                   │                                                   │
90       │                             │                                     ⁢             │                                                   │
91       │                             │                                     d             │                                                   │
92       │                             │                                     G             │                                                   │
93       │                             │                                                   │                                                   │
94       │                             │                                                   │                                                   │
95       │                             │                                                   │                                                   │
96       │                             │                         </div>                    │                                                   │
97       │                             │                         <div>                     │                                                   │
98       │                             │                                                   │                                                   │
99       │                             │                                                   │                                                   │
100       │                             │                                 Br                │                                                   │
101       │                             │                                 =                 │                                                   │
102       │                             │                                                   │                                                   │
103       │                             │                                     B             │                                                   │
104       │                             │                                     s             │                                                   │
105       │                             │                                                   │                                                   │
106       │                             │                                     ⁢             │                                                   │
107       │                             │                                     s             │                                                   │
108       │                             │                                     B             │                                                   │
109       │                             │                                                   │                                                   │
110       │                             │                                     +             │                                                   │
111       │                             │                                     B             │                                                   │
112       │                             │                                     d             │                                                   │
113       │                             │                                                   │                                                   │
114       │                             │                                     ⁢             │                                                   │
115       │                             │                                     d             │                                                   │
116       │                             │                                     B             │                                                   │
117       │                             │                                                   │                                                   │
118       │                             │                                                   │                                                   │
119       │                             │                                                   │                                                   │
120       │                             │                         </div>                    │                                                   │
121       ├─────────────────────────────┼───────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
122GL_FUNC_SUBTRACT             │ <div>                                             │ <div>                                             │
123       │                             │                                                   │                                                   │
124       │                             │                                                   │                                                   │
125       │                             │                                 Rr                │                                 Ar                │
126       │                             │                                 =                 │                                 =                 │
127       │                             │                                                   │                                                   │
128       │                             │                                     R             │                                     A             │
129       │                             │                                     s             │                                     s             │
130       │                             │                                                   │                                                   │
131       │                             │                                     ⁢             │                                     ⁢             │
132       │                             │                                     s             │                                     s             │
133       │                             │                                     R             │                                     A             │
134       │                             │                                                   │                                                   │
135       │                             │                                     -             │                                     -             │
136       │                             │                                     R             │                                     A             │
137       │                             │                                     d             │                                     d             │
138       │                             │                                                   │                                                   │
139       │                             │                                     ⁢             │                                     ⁢             │
140       │                             │                                     d             │                                     d             │
141       │                             │                                     R             │                                     A             │
142       │                             │                                                   │                                                   │
143       │                             │                                                   │                                                   │
144       │                             │                                                   │                                                   │
145       │                             │                         </div>                    │                         </div>                    │
146       │                             │                         <div>                     │                                                   │
147       │                             │                                                   │                                                   │
148       │                             │                                                   │                                                   │
149       │                             │                                 Gr                │                                                   │
150       │                             │                                 =                 │                                                   │
151       │                             │                                                   │                                                   │
152       │                             │                                     G             │                                                   │
153       │                             │                                     s             │                                                   │
154       │                             │                                                   │                                                   │
155       │                             │                                     ⁢             │                                                   │
156       │                             │                                     s             │                                                   │
157       │                             │                                     G             │                                                   │
158       │                             │                                                   │                                                   │
159       │                             │                                     -             │                                                   │
160       │                             │                                     G             │                                                   │
161       │                             │                                     d             │                                                   │
162       │                             │                                                   │                                                   │
163       │                             │                                     ⁢             │                                                   │
164       │                             │                                     d             │                                                   │
165       │                             │                                     G             │                                                   │
166       │                             │                                                   │                                                   │
167       │                             │                                                   │                                                   │
168       │                             │                                                   │                                                   │
169       │                             │                         </div>                    │                                                   │
170       │                             │                         <div>                     │                                                   │
171       │                             │                                                   │                                                   │
172       │                             │                                                   │                                                   │
173       │                             │                                 Br                │                                                   │
174       │                             │                                 =                 │                                                   │
175       │                             │                                                   │                                                   │
176       │                             │                                     B             │                                                   │
177       │                             │                                     s             │                                                   │
178       │                             │                                                   │                                                   │
179       │                             │                                     ⁢             │                                                   │
180       │                             │                                     s             │                                                   │
181       │                             │                                     B             │                                                   │
182       │                             │                                                   │                                                   │
183       │                             │                                     -             │                                                   │
184       │                             │                                     B             │                                                   │
185       │                             │                                     d             │                                                   │
186       │                             │                                                   │                                                   │
187       │                             │                                     ⁢             │                                                   │
188       │                             │                                     d             │                                                   │
189       │                             │                                     B             │                                                   │
190       │                             │                                                   │                                                   │
191       │                             │                                                   │                                                   │
192       │                             │                                                   │                                                   │
193       │                             │                         </div>                    │                                                   │
194       ├─────────────────────────────┼───────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
195GL_FUNC_REVERSE_SUBTRACT     │ <div>                                             │ <div>                                             │
196       │                             │                                                   │                                                   │
197       │                             │                                                   │                                                   │
198       │                             │                                     Rr            │                                     Ar            │
199       │                             │                                     =             │                                     =             │
200       │                             │                                                   │                                                   │
201       │                             │                                         R         │                                         A         │
202       │                             │                                         d         │                                         d         │
203       │                             │                                                   │                                                   │
204       │                             │                                         ⁢         │                                         ⁢         │
205       │                             │                                         d         │                                         d         │
206       │                             │                                         R         │                                         A         │
207       │                             │                                                   │                                                   │
208       │                             │                                         -         │                                         -         │
209       │                             │                                         R         │                                         A         │
210       │                             │                                         s         │                                         s         │
211       │                             │                                                   │                                                   │
212       │                             │                                         ⁢         │                                         ⁢         │
213       │                             │                                         s         │                                         s         │
214       │                             │                                         R         │                                         A         │
215       │                             │                                                   │                                                   │
216       │                             │                                                   │                                                   │
217       │                             │                                                   │                                                   │
218       │                             │                             </div>                │                             </div>                │
219       │                             │                             <div>                 │                                                   │
220       │                             │                                                   │                                                   │
221       │                             │                                                   │                                                   │
222       │                             │                                     Gr            │                                                   │
223       │                             │                                     =             │                                                   │
224       │                             │                                                   │                                                   │
225       │                             │                                         G         │                                                   │
226       │                             │                                         d         │                                                   │
227       │                             │                                                   │                                                   │
228       │                             │                                         ⁢         │                                                   │
229       │                             │                                         d         │                                                   │
230       │                             │                                         G         │                                                   │
231       │                             │                                                   │                                                   │
232       │                             │                                         -         │                                                   │
233       │                             │                                         G         │                                                   │
234       │                             │                                         s         │                                                   │
235       │                             │                                                   │                                                   │
236       │                             │                                         ⁢         │                                                   │
237       │                             │                                         s         │                                                   │
238       │                             │                                         G         │                                                   │
239       │                             │                                                   │                                                   │
240       │                             │                                                   │                                                   │
241       │                             │                                                   │                                                   │
242       │                             │                             </div>                │                                                   │
243       │                             │                             <div>                 │                                                   │
244       │                             │                                                   │                                                   │
245       │                             │                                                   │                                                   │
246       │                             │                                     Br            │                                                   │
247       │                             │                                     =             │                                                   │
248       │                             │                                                   │                                                   │
249       │                             │                                         B         │                                                   │
250       │                             │                                         d         │                                                   │
251       │                             │                                                   │                                                   │
252       │                             │                                         ⁢         │                                                   │
253       │                             │                                         d         │                                                   │
254       │                             │                                         B         │                                                   │
255       │                             │                                                   │                                                   │
256       │                             │                                         -         │                                                   │
257       │                             │                                         B         │                                                   │
258       │                             │                                         s         │                                                   │
259       │                             │                                                   │                                                   │
260       │                             │                                         ⁢         │                                                   │
261       │                             │                                         s         │                                                   │
262       │                             │                                         B         │                                                   │
263       │                             │                                                   │                                                   │
264       │                             │                                                   │                                                   │
265       │                             │                                                   │                                                   │
266       │                             │                             </div>                │                                                   │
267       ├─────────────────────────────┼───────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
268GL_MIN                       │ <div>                                             │ <div>                                             │
269       │                             │                                                   │                                                   │
270       │                             │                                                   │                                                   │
271       │                             │                                     Rr            │                                     Ar            │
272       │                             │                                     =             │                                     =             │
273       │                             │                                                   │                                                   │
274       │                             │                                         min       │                                         min       │
275       │                             │                                         ⁡         │                                         ⁡         │
276       │                             │                                                   │                                                   │
277       │                             │                                                   │                                                   │
278       │                             │                                                 R │                                                 A │
279       │                             │                                                 s │                                                 s │
280       │                             │                                                   │                                                   │
281       │                             │                                                   │                                                   │
282       │                             │                                                   │                                                   │
283       │                             │                                                 R │                                                 A │
284       │                             │                                                 d │                                                 d │
285       │                             │                                                   │                                                   │
286       │                             │                                                   │                                                   │
287       │                             │                                                   │                                                   │
288       │                             │                                                   │                                                   │
289       │                             │                                                   │                                                   │
290       │                             │                             </div>                │                             </div>                │
291       │                             │                             <div>                 │                                                   │
292       │                             │                                                   │                                                   │
293       │                             │                                                   │                                                   │
294       │                             │                                     Gr            │                                                   │
295       │                             │                                     =             │                                                   │
296       │                             │                                                   │                                                   │
297       │                             │                                         min       │                                                   │
298       │                             │                                         ⁡         │                                                   │
299       │                             │                                                   │                                                   │
300       │                             │                                                   │                                                   │
301       │                             │                                                 G │                                                   │
302       │                             │                                                 s │                                                   │
303       │                             │                                                   │                                                   │
304       │                             │                                                   │                                                   │
305       │                             │                                                   │                                                   │
306       │                             │                                                 G │                                                   │
307       │                             │                                                 d │                                                   │
308       │                             │                                                   │                                                   │
309       │                             │                                                   │                                                   │
310       │                             │                                                   │                                                   │
311       │                             │                                                   │                                                   │
312       │                             │                                                   │                                                   │
313       │                             │                             </div>                │                                                   │
314       │                             │                             <div>                 │                                                   │
315       │                             │                                                   │                                                   │
316       │                             │                                                   │                                                   │
317       │                             │                                     Br            │                                                   │
318       │                             │                                     =             │                                                   │
319       │                             │                                                   │                                                   │
320       │                             │                                         min       │                                                   │
321       │                             │                                         ⁡         │                                                   │
322       │                             │                                                   │                                                   │
323       │                             │                                                   │                                                   │
324       │                             │                                                 B │                                                   │
325       │                             │                                                 s │                                                   │
326       │                             │                                                   │                                                   │
327       │                             │                                                   │                                                   │
328       │                             │                                                   │                                                   │
329       │                             │                                                 B │                                                   │
330       │                             │                                                 d │                                                   │
331       │                             │                                                   │                                                   │
332       │                             │                                                   │                                                   │
333       │                             │                                                   │                                                   │
334       │                             │                                                   │                                                   │
335       │                             │                                                   │                                                   │
336       │                             │                             </div>                │                                                   │
337       ├─────────────────────────────┼───────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
338GL_MAX                       │ <div>                                             │ <div>                                             │
339       │                             │                                                   │                                                   │
340       │                             │                                                   │                                                   │
341       │                             │                                     Rr            │                                     Ar            │
342       │                             │                                     =             │                                     =             │
343       │                             │                                                   │                                                   │
344       │                             │                                         max       │                                         max       │
345       │                             │                                         ⁡         │                                         ⁡         │
346       │                             │                                                   │                                                   │
347       │                             │                                                   │                                                   │
348       │                             │                                                 R │                                                 A │
349       │                             │                                                 s │                                                 s │
350       │                             │                                                   │                                                   │
351       │                             │                                                   │                                                   │
352       │                             │                                                   │                                                   │
353       │                             │                                                 R │                                                 A │
354       │                             │                                                 d │                                                 d │
355       │                             │                                                   │                                                   │
356       │                             │                                                   │                                                   │
357       │                             │                                                   │                                                   │
358       │                             │                                                   │                                                   │
359       │                             │                                                   │                                                   │
360       │                             │                             </div>                │                             </div>                │
361       │                             │                             <div>                 │                                                   │
362       │                             │                                                   │                                                   │
363       │                             │                                                   │                                                   │
364       │                             │                                     Gr            │                                                   │
365       │                             │                                     =             │                                                   │
366       │                             │                                                   │                                                   │
367       │                             │                                         max       │                                                   │
368       │                             │                                         ⁡         │                                                   │
369       │                             │                                                   │                                                   │
370       │                             │                                                   │                                                   │
371       │                             │                                                 G │                                                   │
372       │                             │                                                 s │                                                   │
373       │                             │                                                   │                                                   │
374       │                             │                                                   │                                                   │
375       │                             │                                                   │                                                   │
376       │                             │                                                 G │                                                   │
377       │                             │                                                 d │                                                   │
378       │                             │                                                   │                                                   │
379       │                             │                                                   │                                                   │
380       │                             │                                                   │                                                   │
381       │                             │                                                   │                                                   │
382       │                             │                                                   │                                                   │
383       │                             │                             </div>                │                                                   │
384       │                             │                             <div>                 │                                                   │
385       │                             │                                                   │                                                   │
386       │                             │                                                   │                                                   │
387       │                             │                                     Br            │                                                   │
388       │                             │                                     =             │                                                   │
389       │                             │                                                   │                                                   │
390       │                             │                                         max       │                                                   │
391       │                             │                                         ⁡         │                                                   │
392       │                             │                                                   │                                                   │
393       │                             │                                                   │                                                   │
394       │                             │                                                 B │                                                   │
395       │                             │                                                 s │                                                   │
396       │                             │                                                   │                                                   │
397       │                             │                                                   │                                                   │
398       │                             │                                                   │                                                   │
399       │                             │                                                 B │                                                   │
400       │                             │                                                 d │                                                   │
401       │                             │                                                   │                                                   │
402       │                             │                                                   │                                                   │
403       │                             │                                                   │                                                   │
404       │                             │                                                   │                                                   │
405       │                             │                                                   │                                                   │
406       │                             │                             </div>                │                                                   │
407       └─────────────────────────────┴───────────────────────────────────────────────────┴───────────────────────────────────────────────────┘
408
409       The results of these equations are clamped to the range 0 1.
410
411       The GL_MIN and GL_MAX equations are useful for applications that
412       analyze image data (image thresholding against a constant color, for
413       example). The GL_FUNC_ADD equation is useful for antialiasing and
414       transparency, among other things.
415
416       Initially, both the RGB blend equation and the alpha blend equation are
417       set to GL_FUNC_ADD.
418

NOTES

420       The GL_MIN, and GL_MAX equations do not use the source or destination
421       factors, only the source and destination colors.
422

ERRORS

424       GL_INVALID_ENUM is generated if mode is not one of GL_FUNC_ADD,
425       GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX, or GL_MIN.
426
427       GL_INVALID_VALUE is generated by glBlendEquationi if buf is greater
428       than or equal to the value of GL_MAX_DRAW_BUFFERS.
429

ASSOCIATED GETS

431       glGet() with an argument of GL_BLEND_EQUATION_RGB
432
433       glGet() with an argument of GL_BLEND_EQUATION_ALPHA
434

SEE ALSO

436       glBlendColor(), glBlendFunc()glBlendFuncSeparate()
437
439       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
440       under the SGI Free Software B License. For details, see
441       http://oss.sgi.com/projects/FreeB/.
442

AUTHORS

444       opengl.org
445
446
447
448opengl.org                        06/10/2014               GLBLENDEQUATION(3G)
Impressum