|
|
Line 1: |
Line 1: |
| {{infobox feature
| | #REDIRECT [[GLAPI/glBlendFuncSeparate]] |
| | name = glBlendFunc
| |
| | core = 1.0
| |
| }}
| |
| | |
| '''glBlendFunc:''' specify pixel arithmetic
| |
| | |
| == Function Definition ==
| |
| | |
| void '''glBlendFunc'''(GLenum {{param|sfactor}}, GLenum {{param|dfactor}});
| |
| void '''glBlendFunci'''(GLuint {{param|buf}}, GLenum {{param|sfactor}}, GLenum {{param|dfactor}});
| |
| | |
| ; buf
| |
| : For '''glBlendFunci''', specifies the index of the draw buffer for which to set the blend function.
| |
| ; sfactor
| |
| : Specifies how the red, green, blue, and alpha source blending factors are computed. The initial value is {{enum|GL_ONE}}.
| |
| ; dfactor
| |
| : Specifies how the red, green, blue, and alpha destination blending factors are computed. The following symbolic constants are accepted: {{enum|GL_ZERO}}, {{enum|GL_ONE}}, {{enum|GL_SRC_COLOR}}, {{enum|GL_ONE_MINUS_SRC_COLOR}}, {{enum|GL_DST_COLOR}}, {{enum|GL_ONE_MINUS_DST_COLOR}}, {{enum|GL_SRC_ALPHA}}, {{enum|GL_ONE_MINUS_SRC_ALPHA}}, {{enum|GL_DST_ALPHA}}, {{enum|GL_ONE_MINUS_DST_ALPHA}}. {{enum|GL_CONSTANT_COLOR}}, {{enum|GL_ONE_MINUS_CONSTANT_COLOR}}, {{enum|GL_CONSTANT_ALPHA}}, and {{enum|GL_ONE_MINUS_CONSTANT_ALPHA}}. The initial value is {{enum|GL_ZERO}}.
| |
| | |
| == Description ==
| |
| | |
| These functions operate as their more specific counterparts. '''glBlendFunc''' is equivalent to:
| |
| | |
| {{apifunc|glBlendFuncSeparate}}({{param|sfactor}}, {{param|dfactor}}, {{param|sfactor}}, {{param|dfactor}});
| |
| | |
| ''glBlendFunci'' is equivalent to:
| |
| | |
| {{apifunc|glBlendFuncSeparate|i}}({{param|buf}}, {{param|sfactor}}, {{param|dfactor}}, {{param|sfactor}}, {{param|dfactor}});
| |
| | |
| == Notes ==
| |
| | |
| Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (<math>k_A</math>), representing complete opacity, to 0.0 (0), representing complete transparency.
| |
| | |
| When more than one color buffer is enabled for drawing, the GL performs blending separately for each enabled buffer, using the contents of that buffer for destination color. (See {{apifunc|glDrawBuffer}}.)
| |
| | |
| When dual source blending is enabled (i.e., one of the blend factors requiring the second color input is used), the maximum number of enabled draw buffers is given by {{enum|GL_MAX_DUAL_SOURCE_DRAW_BUFFERS}}, which may be lower than {{enum|GL_MAX_DRAW_BUFFERS}}.
| |
| | |
| == Errors ==
| |
| | |
| {{enum|GL_INVALID_ENUM}} is generated if either {{param|sfactor}} or {{param|dfactor}} is not an accepted value.
| |
| | |
| {{enum|GL_INVALID_VALUE}} is generated by '''glBlendFunci''' if {{param|buf}} is greater than or equal to the value of {{enum|GL_MAX_DRAW_BUFFERS}}.
| |
| | |
| == Associated Gets ==
| |
| | |
| {{apifunc|glGet}} with argument {{enum|GL_BLEND_SRC}}
| |
| | |
| {{apifunc|glGet}} with argument {{enum|GL_BLEND_DST}}
| |
| | |
| {{apifunc|glIsEnabled}} with argument {{enum|GL_BLEND}}
| |
| | |
| | |
| | |
| == See Also ==
| |
| | |
| {{apifunc|glBlendColor}}, {{apifunc|glBlendEquation}}, {{apifunc|glBlendFuncSeparate}}, {{apifunc|glClear}}, {{apifunc|glDrawBuffer}}, {{apifunc|glEnable}}, {{apifunc|glLogicOp}}, {{apifunc|glStencilFunc}}
| |
| | |
| == Copyright ==
| |
| | |
| Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/].
| |
|
| |
|
| [[Category:Core API Ref Post Fragment Shader Operations|BlendFunc]] | | [[Category:Core API Ref Post Fragment Shader Operations|BlendFunc]] |
| [[Category:Core API Reference|BlendFunc]] | | [[Category:Core API Reference|BlendFunc]] |