Web Gl Cheat Sheet Page 3

ADVERTISEMENT

Blending
Stencil buffer
enable|disable(
enable|disable(
BLEND )
STENCIL_TEST )
void
void
Enable/disable blending
Enable/disable stencil testing.
blendFunc(
stencilFunc(
void
ulong sfactor, ulong dfactor )
void
ulong func, long ref, ulong mask )
Specify pixel arithmetic. Accepted values for sfactor
Set front and back function and reference value for
and dfactor are:
stencil testing. Parameter func is one of:
ZERO
ONE
NEVER
LESS
EQUAL
LEQUAL
SRC_COLOR
DST_COLOR
GREATER
NOTEQUAL GEQUAL
ALWAYS
SRC_ALPHA
DST_ALPHA
stencilFuncSeparate(
ulong face, ulong func,
void
CONSTANT_COLOR
CONSTANT_ALPHA
long ref, ulong mask )
ONE_MINUS_SRC_ALPHA
ONE_MINUS_DST_ALPHA
Set front and/or back function and reference value for
ONE_MINUS_SRC_COLOR
ONE_MINUS_DST_COLOR
stencil testing. Accepted values for face are:
ONE_MINUS_CONSTANT_COLOR
FRONT
BACK
FRONT_AND_BACK
ONE_MINUS_CONSTANT_ALPHA
stencilMask(
void
ulong mask )
In addition, sfactor can also be SRC_ALPHA_SATURATE
Control the front and back writing of individual bits in
blendFuncSeparate(
ulong srcRGB, ulong dstRGB,
void
the stencil planes.
ulong srcAlpha, ulong dstAlpha )
stencilMaskSeparate(
void
ulong face, ulong mask )
Specify pixel arithmetic for RGB and alpha components
Control the front and/or back writing of individual bits
separately.
in the stencil planes.
blendEquation(
ulong mode )
void
stencilOp(
void
ulong sfail, ulong dpfail, ulong dppass )
Specify the equation used for both the RGB blend
Set front and back stencil test actions. Accepted values
equation and the Alpha blend equation. Accepted
for sfail, dpfail and dppass are:
values for mode are:
KEEP
ZERO
INCR
INCR_WRAP
FUNC_ADD
FUNC_SUBTRACT
REPLACE
INVERT
DECR
DECR_WRAP
FUNC_REVERSE_SUBTRACT
stencilOpSeparate(
ulong face, ulong sfail,
void
blendEquationSeparate(
ulong modeRGB,
void
ulong dpfail, ulong dppass )
ulong modeAlpha )
Set front and/or back stencil test actions.
Set the RGB blend equation and the alpha blend
clearStencil(
long s )
void
equation separately.
Specify the clear value for the stencil buffer.
blendColor(
void
float red, float green,
getParameter(
any
ulong pname )
float blue, float alpha )
Relevant parameters:
Set the blend color
STENCIL_TEST
STENCIL_CLEAR_VALUE
getParameter(
any
ulong pname )
STENCIL_FUNC
STENCIL_FAIL
Relevant parameters:
STENCIL_REF
STENCIL_VALUE_MASK
BLEND
BLEND_COLOR
STENCIL_WRITEMASK
STENCIL_BACK_FUNC
BLEND_DST_RGB
BLEND_SRC_RGB
STENCIL_BACK_FAIL
STENCIL_BACK_REF
BLEND_DST_ALPHA
BLEND_SRC_ALPHA
STENCIL_BITS
STENCIL_BACK_WRITEMASK
BLEND_EQUATION_RGB
BLEND_EQUATION_ALPHA
STENCIL_BACK_VALUE_MASK
STENCIL_BACK_PASS_DEPTH_FAIL
Depth buffer
STENCIL_BACK_PASS_DEPTH_PASS
STENCIL_PASS_DEPTH_FAIL
enable|disable(
DEPTH_TEST )
void
STENCIL_PASS_DEPTH_PASS
Enable/disable depth testing.
depthFunc(
ulong func )
void
Array data
Specify the value used for depth buffer comparisons.
Parameter func is one of:
createFloatArray(
Array values )
Object
NEVER
LESS
EQUAL
LEQUAL
createByteArray(
Array values )
Object
GREATER
NOTEQUAL GEQUAL
ALWAYS
createUnsignedByteArray(
Array values )
Object
depthMask(
void
bool flag )
createShortArray(
Array values )
Object
Enable or disable writing into the depth buffer.
createUnsignedShortArray(
Object
Array values )
depthRange(
float nearVal, float farVal )
void
createIntArray(
Object
Array values )
Specify mapping of depth values from normalized
createUnsignedIntArray(
Object
Array values )
device coordinates to window coordinates.
Create WebGL array objects from JS arrays.
clearDepth(
float depth )
void
drawArrays(
void
ulong mode, long first, ulong count )
Specify the clear value for the depth buffer
Render primitives from array data. Accepted mode
enable|disable(
void
POLYGON_OFFSET_FILL )
values are:
Enable/disable polygon offset.
POINTS
LINES
LINE_LOOP
polygonOffset(
void
float factor, float units )
LINE_STRIP
TRIANGLES
TRIANGLE_STRIP
Set the scale and units used to calculate depth values.
TRIANGLE_FAN
getParameter(
ulong pname )
any
drawElements(
void
ulong mode, ulong count,
Relevant parameters:
ulong type, ulong offset )
DEPTH_TEST
DEPTH_RANGE
Render primitives from array data. Accepted type
DEPTH_WRITEMASK
DEPTH_CLEAR_VALUE
values are:
DEPTH_FUNC
DEPTH_BITS
UNSIGNED_BYTE
UNSIGNED_SHORT
POLYGON_OFFSET_UNITS POLYGON_OFFSET_FACTOR

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4