Sets the scale and bias used to calculate z values.
OpenGL C bindings library: libGL.a
void glPolygonOffsetEXT(GLfloat factor, GLfloat bias)
When GL_POLYGON_OFFSET_EXT is enabled, each fragment's z value will be offset after it is interpolated from the z values of the appropriate vertices. The value of the offset is factor * DZ + bias, where DZ is a measurement of the change in z relative to the screen area of the polygon. The offset is added before the Depth Test is performed and before the value is written into the Depth Buffer.
Initially GL_POLYGON_OFFSET_FACTOR_EXT and GL_POLYGON_OFFSET_BIAS_EXT are both set to 0.0.
This is useful for rendering hidden line images, for applying decals to surfaces, and for rendering solids with highlighted edges.
factor | specifies a scale factor which is used to create a offset for each polygon. |
bias | specifies a constant which is added to each polygon's z offset. |
glPolygonOffsetEXT is part of the EXT_polygon_offset extension, not part of the core GL command set. If GL_EXT_polygon_offset is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_polygon_offset is supported by the connection.
GL_INVALID_OPERATION is generated if glPolygonOffsetEXT is executed between the execution of glBegin and the corresponding execution of glEnd.
glIsEnabled with argument GL_POLYGON_OFFSET_EXT.
glGet with argument GL_POLYGON_OFFSET_FACTOR_EXT or GL_POLYGON_OFFSET_BIAS_EXT .
/usr/include/GL/glext.h | Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
The glDepthFunc subroutine, glEnable orglDisable subroutine, glGet subroutine, glIsEnabled subroutine, glLineWidth subroutine, glStencilOp subroutine, glTexEnv subroutine.