/opengl/docs/man_pages/hardcopy/gl/html/gl/

Size: px
Start display at page:

Download "/opengl/docs/man_pages/hardcopy/gl/html/gl/"

Transcription

1 Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ Name Last modified Size Description Parent Directory accum.html 09-Sep-97 16:16 5K alphafunc.html 09-Sep-97 16:16 3K aretexturesresident.h+ 09-Sep-97 16:17 3K arrayelement.html 09-Sep-97 16:17 2K begin.html 09-Sep-97 16:17 8K bindtexture.html 09-Sep-97 16:18 4K bitmap.html 09-Sep-97 16:17 4K blendcolorext.html 09-Sep-97 16:16 1K blendfunc.html 09-Sep-97 16:17 8K calllist.html 09-Sep-97 16:17 2K calllists.html 09-Sep-97 16:17 6K clear.html 09-Sep-97 16:16 3K clearaccum.html 09-Sep-97 16:17 1K clearcolor.html 09-Sep-97 16:17 1K cleardepth.html 09-Sep-97 16:18 1K clearindex.html 09-Sep-97 16:17 1K clearstencil.html 09-Sep-97 16:16 1K clipplane.html 09-Sep-97 16:17 3K color.html 09-Sep-97 16:16 7K colormask.html 09-Sep-97 16:17 1K colormaterial.html 09-Sep-97 16:17 3K colorpointer.html 09-Sep-97 16:17 4K copypixels.html 09-Sep-97 16:17 9K (1 of 5) [24/09/ :49:30]

2 Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ copyteximage1d.html 09-Sep-97 16:17 5K copyteximage2d.html 09-Sep-97 16:17 5K copytexsubimage1d.htm+ 09-Sep-97 16:18 copytexsubimage2d.htm+ 09-Sep-97 16:18 4K 5K cullface.html 09-Sep-97 16:17 2K deletelists.html 09-Sep-97 16:18 1K deletetextures.html 09-Sep-97 16:17 1K depthfunc.html 09-Sep-97 16:17 2K depthmask.html 09-Sep-97 16:17 1K depthrange.html 09-Sep-97 16:17 2K drawarrays.html 09-Sep-97 16:16 3K drawbuffer.html 09-Sep-97 16:17 4K drawelements.html 09-Sep-97 16:17 3K drawpixels.html 09-Sep-97 16:17 17K edgeflag.html 09-Sep-97 16:16 2K edgeflagpointer.html 09-Sep-97 16:17 3K enable.html 09-Sep-97 16:17 13K enableclientstate.htm+ 09-Sep-97 16:18 3K evalcoord.html 09-Sep-97 16:17 7K evalmesh.html 09-Sep-97 16:17 5K evalpoint.html 09-Sep-97 16:17 2K feedbackbuffer.html 09-Sep-97 16:17 8K finish.html 09-Sep-97 16:16 1K flush.html 09-Sep-97 16:17 1K fog.html 09-Sep-97 16:18 6K frontface.html 09-Sep-97 16:17 2K frustum.html 09-Sep-97 16:17 3K genlists.html 09-Sep-97 16:17 1K gentextures.html 09-Sep-97 16:18 2K (2 of 5) [24/09/ :49:30]

3 Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ get.html 09-Sep-97 16:18 61K getclipplane.html 09-Sep-97 16:17 1K geterror.html 09-Sep-97 16:17 3K getlight.html 09-Sep-97 16:17 7K getmap.html 09-Sep-97 16:17 4K getmaterial.html 09-Sep-97 16:17 4K getpixelmap.html 09-Sep-97 16:17 3K getpointerv.html 09-Sep-97 16:17 1K getpolygonstipple.htm+ 09-Sep-97 16:17 1K getstring.html 09-Sep-97 16:17 3K gettexenv.html 09-Sep-97 16:17 2K gettexgen.html 09-Sep-97 16:17 3K getteximage.html 09-Sep-97 16:17 5K gettexlevelparameter.+ 09-Sep-97 16:17 5K gettexparameter.html 09-Sep-97 16:18 4K hint.html 09-Sep-97 16:17 3K index_.html 09-Sep-97 16:17 2K indexmask.html 09-Sep-97 16:17 1K indexpointer.html 09-Sep-97 16:17 4K initnames.html 09-Sep-97 16:17 1K interleavedarrays.htm+ 09-Sep-97 16:17 3K isenabled.html 09-Sep-97 16:17 4K islist.html 09-Sep-97 16:16 1K istexture.html 09-Sep-97 16:17 1K light.html 09-Sep-97 16:17 10K lightmodel.html 09-Sep-97 16:17 6K linestipple.html 09-Sep-97 16:17 3K linewidth.html 09-Sep-97 16:17 3K listbase.html 09-Sep-97 16:17 1K (3 of 5) [24/09/ :49:30]

4 Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ loadidentity.html 09-Sep-97 16:17 1K loadmatrix.html 09-Sep-97 16:17 2K loadname.html 09-Sep-97 16:17 1K logicop.html 09-Sep-97 16:16 4K map1.html 09-Sep-97 16:17 9K map2.html 09-Sep-97 16:17 12K mapgrid.html 09-Sep-97 16:17 3K material.html 09-Sep-97 16:17 7K matrixmode.html 09-Sep-97 16:17 1K multmatrix.html 09-Sep-97 16:17 3K newlist.html 09-Sep-97 16:16 5K normal.html 09-Sep-97 16:17 3K normalpointer.html 09-Sep-97 16:17 4K ortho.html 09-Sep-97 16:17 3K passthrough.html 09-Sep-97 16:17 1K pixelmap.html 09-Sep-97 16:16 8K pixelstore.html 09-Sep-97 16:17 14K pixeltransfer.html 09-Sep-97 16:17 13K pixelzoom.html 09-Sep-97 16:17 1K pointsize.html 09-Sep-97 16:17 4K polygonmode.html 09-Sep-97 16:18 3K polygonoffset.html 09-Sep-97 16:17 2K polygonstipple.html 09-Sep-97 16:17 2K prioritizetextures.ht+ 09-Sep-97 16:17 3K pushattrib.html 09-Sep-97 16:17 10K pushclientattrib.html 09-Sep-97 16:17 3K pushmatrix.html 09-Sep-97 16:17 3K pushname.html 09-Sep-97 16:17 2K rasterpos.html 09-Sep-97 16:17 8K (4 of 5) [24/09/ :49:30]

5 Index of /opengl/docs/man_pages/hardcopy/gl/html/gl/ readbuffer.html 09-Sep-97 16:17 2K readpixels.html 09-Sep-97 16:17 11K rect.html 09-Sep-97 16:17 2K rendermode.html 09-Sep-97 16:17 3K rotate.html 09-Sep-97 16:17 2K scale.html 09-Sep-97 16:16 2K scissor.html 09-Sep-97 16:17 2K selectbuffer.html 09-Sep-97 16:17 4K shademodel.html 09-Sep-97 16:17 3K stencilfunc.html 09-Sep-97 16:17 5K stencilmask.html 09-Sep-97 16:17 1K stencilop.html 09-Sep-97 16:17 5K texcoord.html 09-Sep-97 16:16 5K texcoordpointer.html 09-Sep-97 16:18 4K texenv.html 09-Sep-97 16:17 8K texgen.html 09-Sep-97 16:17 8K teximage1d.html 09-Sep-97 16:17 14K teximage2d.html 09-Sep-97 16:17 14K texparameter.html 09-Sep-97 16:17 11K texsubimage1d.html 09-Sep-97 16:17 5K texsubimage2d.html 09-Sep-97 16:17 5K translate.html 09-Sep-97 16:17 2K vertex.html 09-Sep-97 16:17 4K vertexpointer.html 09-Sep-97 16:17 4K viewport.html 09-Sep-97 16:17 2K (5 of 5) [24/09/ :49:30]

6 NAME glaccum - operate on the accumulation buffer C SPECIFICATION void glaccum( GLenum op, GLfloat value ) PARAMETERS op Specifies the accumulation buffer operation. Symbolic constants GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are accepted. value Specifies a floating-point value used in the accumulation buffer operation. op determines how value is used. DESCRIPTION The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices. Each pixel in the accumulation buffer consists of red, green, blue, and alpha values. The number of bits per component in the accumulation buffer depends on the implementation. You can examine this number by calling glgetintegerv four times, with arguments GL_ACCUM_RED_BITS, GL_ACCUM_GREEN_BITS, GL_ACCUM_BLUE_BITS, and GL_ACCUM_ALPHA_BITS. Regardless of the number of bits per component, the range of values stored by each component is [-1, 1]. The accumulation buffer pixels are mapped one-toone with frame buffer pixels. glaccum operates on the accumulation buffer. The first argument, op, is a symbolic constant that selects an accumulation buffer operation. The second argument, value, is a floating-point value to be used in that operation. Five operations are specified: GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN. (1 of 4) [24/09/ :49:32]

7 All accumulation buffer operations are limited to the area of the current scissor box and applied identically to the red, green, blue, and alpha components of each pixel. If a glaccum operation results in a value outside the range [-1, 1], the contents of an accumulation buffer pixel component are undefined. The operations are as follows: GL_ACCUM GL_LOAD GL_ADD GL_MULT GL_RETURN Obtains R, G, B, and A values from the buffer currently selected for reading (see glreadbuffer). Each component value is divided by 2n-1, where n is the number of bits allocated to each color component in the currently selected buffer. The result is a floating-point value in the range [0, 1], which is multiplied by value and added to the corresponding pixel component in the accumulation buffer, thereby updating the accumulation buffer. Similar to GL_ACCUM, except that the current value in the accumulation buffer is not used in the calculation of the new value. That is, the R, G, B, and A values from the currently selected buffer are divided by 2n-1, multiplied by value, and then stored in the corresponding accumulation buffer cell, overwriting the current value. Adds value to each R, G, B, and A in the accumulation buffer. Multiplies each R, G, B, and A in the accumulation buffer by value and returns the scaled component to its corresponding accumulation buffer location. Transfers accumulation buffer values to the color buffer or buffers currently selected for writing. Each R, G, B, and A component is multiplied by value, then multiplied by 2n-1, clamped to the range [0,2n-1], and stored in the corresponding display buffer cell. The only fragment operations that are applied to this transfer are pixel ownership, scissor, (2 of 4) [24/09/ :49:32]

8 dithering, and color writemasks. To clear the accumulation buffer, call glclearaccum with R, G, B, and A values to set it to, then call glclear with the accumulation buffer enabled. NOTES Only pixels within the current scissor box are updated by a glaccum operation. ERRORS GL_INVALID_ENUM is generated if op is not an accepted value. GL_INVALID_OPERATION is generated if there is no accumulation buffer. GL_INVALID_OPERATION is generated if glaccum is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_ACCUM_RED_BITS glget with argument GL_ACCUM_GREEN_BITS glget with argument GL_ACCUM_BLUE_BITS glget with argument GL_ACCUM_ALPHA_BITS SEE ALSO glblendfunc, glclear, glclearaccum, glcopypixels, glget, gllogicop, glpixelstore, glpixeltransfer, glreadbuffer, glreadpixels, glscissor, glstencilop (3 of 4) [24/09/ :49:32]

9 (4 of 4) [24/09/ :49:32]

10 NAME glalphafunc - specify the alpha test function C SPECIFICATION void glalphafunc( GLenum func, GLclampf ref ) PARAMETERS func Specifies the alpha comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The initial value is GL_ALWAYS. ref Specifies the reference value that incoming alpha values are compared to. This value is clamped to the range 0 through 1, where 0 represents the lowest possible alpha value and 1 the highest possible value. The initial reference value is 0. DESCRIPTION The alpha test discards fragments depending on the outcome of a comparison between an incoming fragment's alpha value and a constant reference value. glalphafunc specifies the reference value and the comparison function. The comparison is performed only if alpha testing is enabled. By default, it is not enabled. (See glenable and gldisable of GL_ALPHA_TEST.) func and ref specify the conditions under which the pixel is drawn. The incoming alpha value is compared to ref using the function specified by func. If the value passes the comparison, the incoming fragment is drawn if it also passes subsequent stencil and depth buffer tests. If the value fails the comparison, no change is made to the frame buffer at that pixel location. The comparison functions are as follows: GL_NEVER GL_LESS GL_EQUAL Never passes. Passes if the incoming alpha value is less than the reference value. Passes if the incoming alpha value is (1 of 3) [24/09/ :49:33]

11 equal to the reference value. GL_LEQUAL GL_GREATER GL_NOTEQUAL GL_GEQUAL GL_ALWAYS Passes if the incoming alpha value is less than or equal to the reference value. Passes if the incoming alpha value is greater than the reference value. Passes if the incoming alpha value is not equal to the reference value. Passes if the incoming alpha value is greater than or equal to the reference value. Always passes (initial value). glalphafunc operates on all pixel write operations, including those resulting from the scan conversion of points, lines, polygons, and bitmaps, and from pixel draw and copy operations. glalphafunc does not affect screen clear operations. NOTES Alpha testing is performed only in RGBA mode. ERRORS GL_INVALID_ENUM is generated if func is not an accepted value. GL_INVALID_OPERATION is generated if glalphafunc is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_ALPHA_TEST_FUNC glget with argument GL_ALPHA_TEST_REF glisenabled with argument GL_ALPHA_TEST SEE ALSO glblendfunc, glclear, gldepthfunc, glenable, glstencilfunc (2 of 3) [24/09/ :49:33]

12 (3 of 3) [24/09/ :49:33]

13 NAME glaretexturesresident - determine if textures are loaded in texture memory C SPECIFICATION GLboolean glaretexturesresident( GLsizei n, const GLuint *textures, GLboolean *residences ) PARAMETERS n textures Specifies the number of textures to be queried. Specifies an array containing the names of the textures to be queried. residences Specifies an array in which the texture residence status is returned. The residence status of a texture named by an element of textures is returned in the corresponding element of residences. DESCRIPTION GL establishes a ``working set'' of textures that are resident in texture memory. These textures can be bound to a texture target much more efficiently than textures that are not resident. glaretexturesresident queries the texture residence status of the n textures named by the elements of textures. If all the named textures are resident, glaretexturesresident returns GL_TRUE, and the contents of residences are undisturbed. If not all the named textures are resident, glaretexturesresident returns GL_FALSE, and detailed status is returned in the n elements of residences. If an element of residences is GL_TRUE, then the texture named by the corresponding element of textures is resident. The residence status of a single bound texture may also be queried by calling glgettexparameter with the target argument set to the target to which the texture is bound, and the p_name argument set to GL_TEXTURE_RESIDENT. This is the only way that the residence status of a default texture can be queried. (1 of 3) [24/09/ :49:33]

14 NOTES glaretexturesresident is available only if the GL version is 1.1 or greater. glaretexturesresident returns the residency status of the textures at the time of invocation. It does not guarantee that the textures will remain resident at any other time. If textures reside in virtual memory (there is no texture memory), they are considered always resident. Some implementations may not load a texture until the first use of that texture. ERRORS GL_INVALID_VALUE is generated if n is negative. GL_INVALID_VALUE is generated if any element in textures is 0 or does not name a texture. In that case, the function returns GL_FALSE and the contents of residences is indeterminate. GL_INVALID_OPERATION is generated if glaretexturesresident is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glgettexparameter with parameter name GL_TEXTURE_RESIDENT retrieves the residence status of a currently bound texture. SEE ALSO glbindtexture, glgettexparameter, glprioritizetextures, glteximage1d, glteximage2d, gltexparameter (2 of 3) [24/09/ :49:33]

15 (3 of 3) [24/09/ :49:33]

16 NAME glarrayelement - render a vertex using the specified vertex array element C SPECIFICATION void glarrayelement( GLint i ) PARAMETERS i Specifies an index into the enabled vertex data arrays. DESCRIPTION glarrayelement commands are used within glbegin/glend pairs to specify vertex and attribute data for point, line, and polygon primitives. If GL_VERTEX_ARRAY is enabled when glarrayelement is called, a single vertex is drawn, using vertex and attribute data taken from location i of the enabled arrays. If GL_VERTEX_ARRAY is not enabled, no drawing occurs but the attributes corresponding to the enabled arrays are modified. Use glarrayelement to construct primitives by indexing vertex data, rather than by streaming through arrays of data in first-to-last order. Because each call specifies only a single vertex, it is possible to explicitly specify perprimitive attributes such as a single normal per individual triangle. Changes made to array data between the execution of glbegin and the corresponding execution of glend may affect calls to glarrayelement that are made within the same glbegin/glend period in non-sequential ways. That is, a call to glarrayelement that precedes a change to array data may access the changed data, and a call that follows a change to array data may access original data. NOTES glarrayelement is available only if the GL version is 1.1 or greater. glarrayelement is included in display lists. If glarrayelement is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array (1 of 3) [24/09/ :49:34]

17 pointers and enables are client-side state, their values affect display lists when the lists are created, not when the lists are executed. SEE ALSO glcolorpointer, gldrawarrays, gledgeflagpointer, glgetpointerv, glindexpointer, glinterleavedarrays, glnormalpointer, gltexcoordpointer, glvertexpointer (2 of 3) [24/09/ :49:34]

18 (3 of 3) [24/09/ :49:34]

19 NAME glbegin, glend - delimit the vertices of a primitive or a group of like primitives C SPECIFICATION void glbegin( GLenum mode ) PARAMETERS mode Specifies the primitive or primitives that will be created from vertices presented between glbegin and the subsequent glend. Ten symbolic constants are accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON. C SPECIFICATION void glend( void ) DESCRIPTION glbegin and glend delimit the vertices that define a primitive or a group of like primitives. glbegin accepts a single argument that specifies in which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows: GL_POINTS GL_LINES GL_LINE_STRIP GL_LINE_LOOP Treats each vertex as a single point. Vertex n defines point n. N points are drawn. Treats each pair of vertices as an independent line segment. Vertices 2n-1 and 2n define line n. N/2 lines are drawn. Draws a connected group of line segments from the first vertex to the last. Vertices n and n+1 define line n. N-1 lines are drawn. Draws a connected group of line (1 of 4) [24/09/ :49:35]

20 segments from the first vertex to the last, then back to the first. Vertices n and n+1 define line n. The last line, however, is defined by vertices N and 1. N lines are drawn. GL_TRIANGLES GL_TRIANGLE_STRIP GL_TRIANGLE_FAN GL_QUADS GL_QUAD_STRIP GL_POLYGON Treats each triplet of vertices as an independent triangle. Vertices 3n-2, 3n-1, and 3n define triangle n. N/3 triangles are drawn. Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. For odd n, vertices n, n+1, and n+2 define triangle n. For even n, vertices n+1, n, and n+2 define triangle n. N-2 triangles are drawn. Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. Vertices 1, n+1, and n+2 define triangle n. N-2 triangles are drawn. Treats each group of four vertices as an independent quadrilateral. Vertices 4n-3, 4n-2, 4n-1, and 4n define quadrilateral n. N/4 quadrilaterals are drawn. Draws a connected group of quadrilaterals. One quadrilateral is defined for each pair of vertices presented after the first pair. Vertices 2n-1, 2n, 2n+2, and 2n+1 define quadrilateral n. N/2-1 quadrilaterals are drawn. Note that the order in which vertices are used to construct a quadrilateral from strip data is different from that used with independent data. Draws a single, convex polygon. Vertices 1 through N define this polygon. (2 of 4) [24/09/ :49:35]

21 Only a subset of GL commands can be used between glbegin and glend. The commands are glvertex, glcolor, glindex, glnormal, gltexcoord, glevalcoord, glevalpoint, glarrayelement, glmaterial, and gledgeflag. Also, it is acceptable to use glcalllist or glcalllists to execute display lists that include only the preceding commands. If any other GL command is executed between glbegin and glend, the error flag is set and the command is ignored. Regardless of the value chosen for mode, there is no limit to the number of vertices that can be defined between glbegin and glend. Lines, triangles, quadrilaterals, and polygons that are incompletely specified are not drawn. Incomplete specification results when either too few vertices are provided to specify even a single primitive or when an incorrect multiple of vertices is specified. The incomplete primitive is ignored; the rest are drawn. The minimum specification of vertices for each primitive is as follows: 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral, and 3 for a polygon. Modes that require a certain multiple of vertices are GL_LINES (2), GL_TRIANGLES (3), GL_QUADS (4), and GL_QUAD_STRIP (2). ERRORS GL_INVALID_ENUM is generated if mode is set to an unaccepted value. GL_INVALID_OPERATION is generated if glbegin is executed between a glbegin and the corresponding execution of glend. GL_INVALID_OPERATION is generated if glend is executed without being preceded by a glbegin. GL_INVALID_OPERATION is generated if a command other than glvertex, glcolor, glindex, glnormal, gltexcoord, glevalcoord, glevalpoint, glarrayelement, glmaterial, gledgeflag, glcalllist, or glcalllists is executed between the execution of glbegin and the corresponding execution glend. Execution of glenableclientstate, gldisableclientstate, gledgeflagpointer, gltexcoordpointer, glcolorpointer, glindexpointer, glnormalpointer, glvertexpointer, glinterleavedarrays, or glpixelstore is not (3 of 4) [24/09/ :49:35]

22 allowed after a call to glbegin and before the corresponding call to glend, but an error may or may not be generated. SEE ALSO glarrayelement, glcalllist, glcalllists, glcolor, gledgeflag, glevalcoord, glevalpoint, glindex, glmaterial, glnormal, gltexcoord, glvertex (4 of 4) [24/09/ :49:35]

23 NAME glbindtexture - bind a named texture to a texturing target C SPECIFICATION void glbindtexture( GLenum target, GLuint texture ) PARAMETERS target Specifies the target to which the texture is bound. Must be either GL_TEXTURE_1D or GL_TEXTURE_2D. texture Specifies the name of a texture. DESCRIPTION glbindtexture lets you create or use a named texture. Calling glbindtexture with target set to GL_TEXTURE_1D or GL_TEXTURE_2D and texture set to the name of the newtexture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken. Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared display-list space (see glxcreatecontext) of the current GL rendering context; two rendering contexts share texture names only if they also share display lists. You may use glgentextures to generate a set of new texture names. When a texture is first bound, it assumes the dimensionality of its target: A texture first bound to GL_TEXTURE_1D becomes 1-dimensional and a texture first bound to GL_TEXTURE_2D becomes 2-dimensional. The state of a 1- dimensional texture immediately after it is first bound is equivalent to the state of the default GL_TEXTURE_1D at GL initialization, and similarly for 2-dimensional textures. While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound (1 of 3) [24/09/ :49:36]

24 texture. If texture mapping of the dimensionality of the target to which a texture is bound is active, the bound texture is used. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization. A texture binding created with glbindtexture remains active until a different texture is bound to the same target, or until the bound texture is deleted with gldeletetextures. Once created, a named texture may be re-bound to the target of the matching dimensionality as often as needed. It is usually much faster to use glbindtexture to bind an existing named texture to one of the texture targets than it is to reload the texture image using glteximage1d or glteximage2d. For additional control over performance, use glprioritizetextures. glbindtexture is included in display lists. NOTES glbindtexture is available only if the GL version is 1.1 or greater. ERRORS GL_INVALID_ENUM is generated if target is not one of the allowable values. GL_INVALID_OPERATION is generated if texture has a dimensionality which doesn't match that of target. GL_INVALID_OPERATION is generated if glbindtexture is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_TEXTURE_1D_BINDING glget with argument GL_TEXTURE_2D_BINDING SEE ALSO glaretexturesresident, gldeletetextures, glgentextures, glget, glgettexparameter, glistexture, glprioritizetextures, glteximage1d, glteximage2d, gltexparameter (2 of 3) [24/09/ :49:36]

25 (3 of 3) [24/09/ :49:36]

26 NAME glbitmap - draw a bitmap C SPECIFICATION void glbitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) PARAMETERS width, height Specify the pixel width and height of the bitmap image. xorig, yorig Specify the location of the origin in the bitmap image. The origin is measured from the lower left corner of the bitmap, with right and up being the positive axes. xmove, ymove Specify the x and y offsets to be added to the current raster position after the bitmap is drawn. bitmap Specifies the address of the bitmap image. DESCRIPTION A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to 1's in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0's in the bitmap are not modified. glbitmap takes seven arguments. The first pair specifies the width and height of the bitmap image. The second pair specifies the location of the bitmap origin relative to the lower left corner of the bitmap image. The third pair of arguments specifies x and y offsets to be added to the current raster position after the bitmap has been drawn. The final argument is a pointer to the bitmap image itself. (1 of 3) [24/09/ :49:37]

27 The bitmap image is interpreted like image data for the gldrawpixels command, with width and height corresponding to the width and height arguments of that command, and with type set to GL_BITMAP and format set to GL_COLOR_INDEX. Modes specified using glpixelstore affect the interpretation of bitmap image data; modes specified using glpixeltransfer do not. If the current raster position is invalid, glbitmap is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the window coordinates x = x - x w r o y = y - y w r o where (x,y ) is the raster position and (x,y ) is the bitmap origin. Fragments are then generated for each pixel corresponding to a 1 (one) in the bitmap image. These fragments are generated using the current raster z coordinate, color or color index, and current raster texture coordinates. They are then treated just as if they had been generated by a point, line, or polygon, including texture mapping, fogging, and all per-fragment operations such as alpha and depth testing. After the bitmap has been drawn, the x and y coordinates of the current raster position are offset by xmove and ymove. No change is made to the z coordinate of the current raster position, or to the current raster color, texture coordinates, or index. NOTES To set a valid raster position outside the viewport, first set a valid raster position inside the viewport, then call glbitmap with NULL as the bitmap parameter and with xmove and ymove set to the offsets of the new raster position. This technique is useful when panning an image around the viewport. ERRORS GL_INVALID_VALUE is generated if width or height is negative. GL_INVALID_OPERATION is generated if glbitmap is executed between the execution of glbegin and the corresponding (2 of 3) [24/09/ :49:37]

28 execution of glend. ASSOCIATED GETS glget with argument GL_CURRENT_RASTER_POSITION glget with argument GL_CURRENT_RASTER_COLOR glget with argument GL_CURRENT_RASTER_INDEX glget with argument GL_CURRENT_RASTER_TEXTURE_COORDS glget with argument GL_CURRENT_RASTER_POSITION_VALID SEE ALSO gldrawpixels, glpixelstore, glpixeltransfer, glrasterpos (3 of 3) [24/09/ :49:37]

29 NAME glblendcolorext - set the blend color C SPECIFICATION void glblendcolorext( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) PARAMETERS GL_BLEND_COLOR_EXT red, green, blue, alpha specify the components of DESCRIPTION The GL_BLEND_COLOR_EXT may be used to calculate the source and destination blending factors. See glblendfunc for a complete description of the blending operations. Initially the GL_BLEND_COLOR_EXT is set to (0,0,0,0). NOTES glblendcolorext is part of the EXT_blend_color extension, not part of the core GL command set. If GL_EXT_blend_color is included in the string returned by glgetstring, when called with argument GL_EXTENSIONS, extension EXT_blend_color is supported by the connection. ERRORS GL_INVALID_OPERATION is generated if glblendcolorext is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with an argument of GL_BLEND_COLOR_EXT. SEE ALSO glblendfunc, glgetstring. (1 of 2) [24/09/ :49:37]

30 (2 of 2) [24/09/ :49:37]

31 NAME glblendfunc - specify pixel arithmetic C SPECIFICATION void glblendfunc( GLenum sfactor, GLenum dfactor ) PARAMETERS sfactor Specifies how the red, green, blue, and alpha source blending factors are computed. Nine symbolic constants are accepted: GL_ZERO, GL_ONE, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, and GL_SRC_ALPHA_SATURATE. The initial value is GL_ONE. dfactor Specifies how the red, green, blue, and alpha destination blending factors are computed. Eight symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, and GL_ONE_MINUS_DST_ALPHA. The initial value is GL_ZERO. DESCRIPTION In RGBA mode, pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use glenable and gldisable with argument GL_BLEND to enable and disable blending. glblendfunc defines the operation of blending when it is enabled. sfactor specifies which of nine methods is used to scale the source color components. dfactor specifies which of eight methods is used to scale the destination color components. The eleven possible methods are described in the following table. Each method defines four scale factors, one each for red, green, blue, and alpha. In the table and in subsequent equations, source and destination color components are referred to as (R,G,B,A ) and (R,G,B,A ). They are understood to have integer values between 0dand (k,k,k,k ), where R G B A mc (1 of 4) [24/09/ :49:38]

32 kc = 2-1 and (mr,mg,mb,ma) is the number of red, green, blue, and alpha bitplanes. Source and destination scale factors are referred to as (s,s,s,s ) and (d,d,d,d ). The scale factors described in the table,gdenoted (f,f,f,f ), represent either source or destination factors.g All scale factors have range [0,1]. parameter (f, f, f, f ) GL_ZERO (0, 0, 0, 0) GL_ONE (1, 1, 1, 1) GL_SRC_COLOR (R /k, G /k, B /k, A /k ) GL_ONE_MINUS_SRC_COLOR (1, 1, 1,s1)R- (R /k, G /k, B /k, A /k ) GL_DST_COLOR (R /k, G /k, B /k, A /k ) s A GL_ONE_MINUS_DST_COLOR (1, 1, 1,d1)R- (R /k, G /k, B /k, A /k ) GL_SRC_ALPHA (A /k, A /k, A /k, A /k ) d A GL_ONE_MINUS_SRC_ALPHA (1, 1, 1,s1)A- (A /k, A /k, A /k, A /k ) GL_DST_ALPHA (A /k, A /k, A /k, A /k ) s A GL_ONE_MINUS_DST_ALPHA (1, 1, 1,d1)A- (A /k, A /k, A /k, A /k ) GL_SRC_ALPHA_SATURATE (i, i, i,d1)a d A d A In the table, i = min(a, k -A ) / k s A d A To determine the blended RGBA values of a pixel when drawing in RGBA mode, the system uses the following equations: R = min(k, R s +R d ) Gd = min(kr, GssR+GddR) Bd = min(kg, BssG+BddG) Ad = min(kb, AssB+AddB) d A s A d A Despite the apparent precision of the above equations, blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend factor equal to 0 reduces its multiplicand to 0. For example, when sfactor is GL_SRC_ALPHA, dfactor is GL_ONE_MINUS_SRC_ALPHA, and A is equal to k, the equations reduce to simple replacement:s A R = R (2 of 4) [24/09/ :49:38]

33 Gd = Gs Bd = Bs Ad = As d s EXAMPLES Transparency is best implemented using blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) with primitives sorted from farthest to nearest. Note that this transparency calculation does not require the presence of alpha bitplanes in the frame buffer. Blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is also useful for rendering antialiased points and lines in arbitrary order. Polygon antialiasing is optimized using blend function (GL_SRC_ALPHA_SATURATE, GL_ONE) with polygons sorted from nearest to farthest. (See the glenable, gldisable reference page and the GL_POLYGON_SMOOTH argument for information on polygon antialiasing.) Destination alpha bitplanes, which must be present for this blend function to operate correctly, store the accumulated coverage. NOTES Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (K ), 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 gldrawbuffer.) Blending affects only RGBA rendering. It is ignored by color index renderers. ERRORS GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value. GL_INVALID_OPERATION is generated if glblendfunc is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_BLEND_SRC glget with argument GL_BLEND_DST glisenabled with argument GL_BLEND (3 of 4) [24/09/ :49:38]

34 SEE ALSO glalphafunc, glclear, gldrawbuffer, glenable, gllogicop, glstencilfunc (4 of 4) [24/09/ :49:38]

35 NAME glcalllist - execute a display list C SPECIFICATION void glcalllist( GLuint list ) PARAMETERS list Specifies the integer name of the display list to be executed. DESCRIPTION glcalllist causes the named display list to be executed. The commands saved in the display list are executed in order, just as if they were called without using a display list. If list has not been defined as a display list, glcalllist is ignored. glcalllist can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, a limit is placed on the nesting level of display lists during display-list execution. This limit is at least 64, and it depends on the implementation. GL state is not saved and restored across a call to glcalllist. Thus, changes made to GL state during the execution of a display list remain after execution of the display list is completed. Use glpushattrib, glpopattrib, glpushmatrix, and glpopmatrix to preserve GL state across glcalllist calls. NOTES Display lists can be executed between a call to glbegin and the corresponding call to glend, as long as the display list includes only commands that are allowed in this interval. ASSOCIATED GETS glget with argument GL_MAX_LIST_NESTING glislist SEE ALSO glcalllists, gldeletelists, glgenlists, glnewlist, glpushattrib, glpushmatrix (1 of 2) [24/09/ :49:39]

36 (2 of 2) [24/09/ :49:39]

37 NAME glcalllists - execute a list of display lists C SPECIFICATION void glcalllists( GLsizei n, GLenum type, const GLvoid *lists ) PARAMETERS n type Specifies the number of display lists to be executed. Specifies the type of values in lists. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, and GL_4_BYTES are accepted. lists Specifies the address of an array of name offsets in the display list. The pointer type is void because the offsets can be bytes, shorts, ints, or floats, depending on the value of type. DESCRIPTION glcalllists causes each display list in the list of names passed as lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored. glcalllists provides an efficient means for executing more than one display list. type allows lists with various name formats to be accepted. The formats are as follows: GL_BYTE GL_UNSIGNED_BYTE GL_SHORT lists is treated as an array of signed bytes, each in the range -128 through 127. lists is treated as an array of unsigned bytes, each in the range 0 through 255. lists is treated as an array of signed two-byte integers, each in the range through (1 of 4) [24/09/ :49:40]

38 GL_UNSIGNED_SHORT lists is treated as an array of unsigned two-byte integers, each in the range 0 through GL_INT GL_UNSIGNED_INT GL_FLOAT GL_2_BYTES GL_3_BYTES GL_4_BYTES lists is treated as an array of signed four-byte integers. lists is treated as an array of unsigned four-byte integers. lists is treated as an array of four-byte floating-point values. lists is treated as an array of unsigned bytes. Each pair of bytes specifies a single display-list name. The value of the pair is computed as 256 times the unsigned value of the first byte plus the unsigned value of the second byte. lists is treated as an array of unsigned bytes. Each triplet of bytes specifies a single displaylist name. The value of the triplet is computed as times the unsigned value of the first byte, plus 256 times the unsigned value of the second byte, plus the unsigned value of the third byte. lists is treated as an array of unsigned bytes. Each quadruplet of bytes specifies a single displaylist name. The value of the quadruplet is computed as times the unsigned value of the first byte, plus times the unsigned value of the second byte, plus 256 times the unsigned value of the third byte, plus the unsigned value of the fourth byte. The list of display-list names is not null-terminated. Rather, n specifies how many names are to be taken from (2 of 4) [24/09/ :49:40]

39 lists. An additional level of indirection is made available with the gllistbase command, which specifies an unsigned offset that is added to each display-list name specified in lists before that display list is executed. glcalllists can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, a limit is placed on the nesting level of display lists during display-list execution. This limit must be at least 64, and it depends on the implementation. GL state is not saved and restored across a call to glcalllists. Thus, changes made to GL state during the execution of the display lists remain after execution is completed. Use glpushattrib, glpopattrib, glpushmatrix, and glpopmatrix to preserve GL state across glcalllists calls. NOTES Display lists can be executed between a call to glbegin and the corresponding call to glend, as long as the display list includes only commands that are allowed in this interval. ERRORS GL_INVALID_VALUE is generated if n is negative. GL_INVALID_ENUM is generated if type is not one of GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, GL_4_BYTES. ASSOCIATED GETS glget with argument GL_LIST_BASE glget with argument GL_MAX_LIST_NESTING glislist SEE ALSO glcalllist, gldeletelists, glgenlists, gllistbase, glnewlist, glpushattrib, glpushmatrix (3 of 4) [24/09/ :49:40]

40 (4 of 4) [24/09/ :49:40]

41 NAME glclear - clear buffers to preset values C SPECIFICATION void glclear( GLbitfield mask ) PARAMETERS mask Bitwise OR of masks that indicate the buffers to be cleared. The four masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT. DESCRIPTION glclear sets the bitplane area of the window to values previously selected by glclearcolor, glclearindex, glcleardepth, glclearstencil, and glclearaccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using gldrawbuffer. The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glclear. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and depth-buffering are ignored by glclear. glclear takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared. The values are as follows: GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT GL_ACCUM_BUFFER_BIT GL_STENCIL_BUFFER_BIT Indicates the buffers currently enabled for color writing. Indicates the depth buffer. Indicates the accumulation buffer. Indicates the stencil buffer. NOTES The value to which each buffer is cleared depends on the setting of the clear value for that buffer. (1 of 3) [24/09/ :49:41]

42 If a buffer is not present, then a glclear directed at that buffer has no effect. ERRORS GL_INVALID_VALUE is generated if any bit other than the four defined bits is set in mask. GL_INVALID_OPERATION is generated if glclear is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_ACCUM_CLEAR_VALUE glget with argument GL_DEPTH_CLEAR_VALUE glget with argument GL_INDEX_CLEAR_VALUE glget with argument GL_COLOR_CLEAR_VALUE glget with argument GL_STENCIL_CLEAR_VALUE SEE ALSO glclearaccum, glclearcolor, glcleardepth, glclearindex, glclearstencil, gldrawbuffer, glscissor (2 of 3) [24/09/ :49:41]

43 (3 of 3) [24/09/ :49:41]

44 NAME glclearaccum - specify clear values for the accumulation buffer C SPECIFICATION void glclearaccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) PARAMETERS red, green, blue, alpha Specify the red, green, blue, and alpha values used when the accumulation buffer is cleared. The initial values are all 0. DESCRIPTION glclearaccum specifies the red, green, blue, and alpha values used by glclear to clear the accumulation buffer. Values specified by glclearaccum are clamped to the range [-1,1]. ERRORS GL_INVALID_OPERATION is generated if glclearaccum is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_ACCUM_CLEAR_VALUE SEE ALSO glclear (1 of 2) [24/09/ :49:41]

45 (2 of 2) [24/09/ :49:41]

46 NAME glclearcolor - specify clear values for the color buffers C SPECIFICATION void glclearcolor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) PARAMETERS red, green, blue, alpha Specify the red, green, blue, and alpha values used when the color buffers are cleared. The initial values are all 0. DESCRIPTION glclearcolor specifies the red, green, blue, and alpha values used by glclear to clear the color buffers. Values specified by glclearcolor are clamped to the range [0,1]. ERRORS GL_INVALID_OPERATION is generated if glclearcolor is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_COLOR_CLEAR_VALUE SEE ALSO glclear (1 of 2) [24/09/ :49:42]

47 (2 of 2) [24/09/ :49:42]

48 NAME glcleardepth - specify the clear value for the depth buffer C SPECIFICATION void glcleardepth( GLclampd depth ) PARAMETERS depth Specifies the depth value used when the depth buffer is cleared. The initial value is 1. DESCRIPTION glcleardepth specifies the depth value used by glclear to clear the depth buffer. Values specified by glcleardepth are clamped to the range [0,1]. ERRORS GL_INVALID_OPERATION is generated if glcleardepth is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_DEPTH_CLEAR_VALUE SEE ALSO glclear (1 of 2) [24/09/ :49:42]

49 (2 of 2) [24/09/ :49:42]

50 NAME glclearindex - specify the clear value for the color index buffers C SPECIFICATION void glclearindex( GLfloat c ) PARAMETERS c Specifies the index used when the color index buffers are cleared. The initial value is 0. DESCRIPTION glclearindex specifies the index used by glclear to clear the color index buffers. c is not clamped. Rather, c is converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2m-1, where m is the number of bits in a color index stored in the frame buffer. ERRORS GL_INVALID_OPERATION is generated if glclearindex is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_INDEX_CLEAR_VALUE glget with argument GL_INDEX_BITS SEE ALSO glclear (1 of 2) [24/09/ :49:43]

51 (2 of 2) [24/09/ :49:43]

52 NAME glclearstencil - specify the clear value for the stencil buffer C SPECIFICATION void glclearstencil( GLint s ) PARAMETERS s Specifies the index used when the stencil buffer is cleared. The initial value is 0. DESCRIPTION glclearstencil specifies the index used by glclear to clear the stencil buffer. s is masked with 2m-1, where m is the number of bits in the stencil buffer. ERRORS GL_INVALID_OPERATION is generated if glclearstencil is executed between the execution of glbegin and the corresponding execution of glend. ASSOCIATED GETS glget with argument GL_STENCIL_CLEAR_VALUE glget with argument GL_STENCIL_BITS SEE ALSO glclear (1 of 2) [24/09/ :49:43]

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. Bing-Yu Chen National Taiwan University Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

More information

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University OpenGL Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University Background Software interface to graphics hardware 250+ commands Objects (models) are built from geometric primitives

More information

Pixels and Buffers. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Pixels and Buffers. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Pixels and Buffers CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce additional OpenGL buffers Learn to read from / write to buffers Introduce

More information

OpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL

OpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL OpenGL (euske) 1 OpenGL - 1.1 OpenGL 1. Client-Server Model 2. 3. 1.2 3D OpenGL (Depth-Buffer Algorithm Z-Buffer Algorithm) (polygon ) ( rendering) Client-Server Model X Window System ( GL ) GL (Indy O

More information

Buffers and Processing Fragments

Buffers and Processing Fragments Buffers and Processing Fragments 2017 Autumn Animação e Visualização Tridimensional 2017/2018 1 OGL Framebuffer Color Buffers: (front back)- (left right) Depth Buffer Stencil Buffer 2 Buffers Intro Buffer

More information

Lectures Display List

Lectures Display List Lectures Display List By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is it? What

More information

Lectures Transparency Case Study

Lectures Transparency Case Study Lectures Transparency Case Study By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 How

More information

CS 5610 / Spring Depth Buffering and Hidden Surface Removal

CS 5610 / Spring Depth Buffering and Hidden Surface Removal Define a buffer by its spatial resolution (n x m) and its depth (or precision) k, the number of bits/pixel Buffers pixel Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 2 Depth

More information

An Interactive Introduction to OpenGL Programming

An Interactive Introduction to OpenGL Programming Define a buffer by its spatial resolution (n n x m) ) and its depth (or precision) k,, the number of bits/pixel Buffers pixel Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 2

More information

Lecture 2 2D transformations Introduction to OpenGL

Lecture 2 2D transformations Introduction to OpenGL Lecture 2 2D transformations Introduction to OpenGL OpenGL where it fits what it contains how you work with it OpenGL parts: GL = Graphics Library (core lib) GLU = GL Utilities (always present) GLX, AGL,

More information

Discrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of

Discrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of Discrete Techniques 11 th Week, 2010 Buffer Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of bits/pixel Pixel OpenGL Frame Buffer OpenGL Buffers Color buffers

More information

Chapter 7 Display Lists

Chapter 7 Display Lists OpenGL Programming Guide (Addison-Wesley Publishing Company) Chapter 7 Display Lists Chapter Objectives After reading this chapter, you ll be able to do the following: Understand how display lists can

More information

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO SANTA BARBARA SANTA CRUZ EECS 104 Fundamentals of Computer Graphics OpenGL Slides courtesy of Dave Shreine, Ed Angel and Vicki Shreiner

More information

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System World Coordinate System Normalized Device Coordinate System (NDC) Model Program Graphics System Workstation Model Program Graphics System Workstation Normally, the User or Object Coordinate System. World

More information

World Coordinate System

World Coordinate System World Coordinate System Application Model Application Program Graphics System Workstation Normally, the User or Object Coordinate System. World Coordinate Window: A subset of the world coordinate system,

More information

CSCI 4620/8626. Primitives and Attributes

CSCI 4620/8626. Primitives and Attributes CSCI 4620/8626 Computer Graphics Attributes of Graphics Primitives (Chapter 5) Last update: 2016-02-23 Primitives and Attributes The graphics primitives we ve seen so far are fundamental shapes, like lines,

More information

Definition. Blending & Compositing. Front & Back Buffers. Left & Right Buffers. Blending combines geometric objects. e.g.

Definition. Blending & Compositing. Front & Back Buffers. Left & Right Buffers. Blending combines geometric objects. e.g. Blending & Compositing COMP 3003 Autumn 2005 Definition Blending combines geometric objects e.g. transparency Compositing combines entire images multi-pass textures accumulating results Both depend on

More information

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40)

Information Coding / Computer Graphics, ISY, LiTH. OpenGL! ! where it fits!! what it contains!! how you work with it 11(40) 11(40) Information Coding / Computer Graphics, ISY, LiTH OpenGL where it fits what it contains how you work with it 11(40) OpenGL The cross-platform graphics library Open = Open specification Runs everywhere

More information

9. Display Lists. Display lists optimize performance by caching and saving end results, thus avoiding many intermediate steps for

9. Display Lists. Display lists optimize performance by caching and saving end results, thus avoiding many intermediate steps for 9. Display Lists OpenGL commands are normally executed in immediate mode A display list is a group of OpenGL commands that have been stored for later execution Display lists are used to - Cache commands

More information

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing EECE 478 Rasterization & Scenes Rasterization Learning Objectives Be able to describe the complete graphics pipeline. Describe the process of rasterization for triangles and lines. Compositing Manipulate

More information

RECITATION - 1. Ceng477 Fall

RECITATION - 1. Ceng477 Fall RECITATION - 1 Ceng477 Fall 2007-2008 2/ 53 Agenda General rules for the course General info on the libraries GLUT OpenGL GLUI Details about GLUT Functions Probably we will not cover this part 3/ 53 General

More information

Display Lists in OpenGL

Display Lists in OpenGL Display Lists in OpenGL Display lists are a mechanism for improving performance of interactive OpenGL applications. A display list is a group of OpenGL commands that have been stored for later execution.

More information

Chapter 10 The Framebuffer Buffers and Their Uses Color Buffers Clearing Buffers Selecting Color Buffers for Writing and Reading Masking Buffers

Chapter 10 The Framebuffer Buffers and Their Uses Color Buffers Clearing Buffers Selecting Color Buffers for Writing and Reading Masking Buffers Chapter 10 The Framebuffer Buffers and Their Uses Color Buffers Clearing Buffers Selecting Color Buffers for Writing and Reading Masking Buffers Testing and Operating on Fragments Scissor Test Alpha Test

More information

E.Order of Operations

E.Order of Operations Appendix E E.Order of Operations This book describes all the performed between initial specification of vertices and final writing of fragments into the framebuffer. The chapters of this book are arranged

More information

CONTENTS... 1 OPENGL REFERENCE MANUAL...

CONTENTS... 1 OPENGL REFERENCE MANUAL... Contents CONTENTS... 1 OPENGL REFERENCE MANUAL... 5 THE OFFICIAL REFERENCE DOCUMENT FOR OPENGL, RELEASE 1... 5 PREFACE... 6 WHAT YOU SHOULD KNOW BEFORE READING THIS MANUAL... 6 ACKNOWLEDGMENTS... 7 CHAPTER

More information

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실. Graphics Texture Mapping 고려대학교컴퓨터그래픽스연구실 3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D Viewing

More information

3D graphic acceleration history and architecture

3D graphic acceleration history and architecture 3D graphic acceleration history and architecture 2003-2017 Josef Pelikán, Jan Horáček CGG MFF UK Praha pepca@cgg.mff.cuni.cz http://cgg.mff.cuni.cz/~pepca/ GPU architecture 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca

More information

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 Announcements Tomorrow: assignment 1 due Grading

More information

Scan line algorithm. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 272

Scan line algorithm. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 272 Scan line algorithm The scan line algorithm is an alternative to the seed fill algorithm. It does not require scan conversion of the edges before filling the polygons It can be applied simultaneously to

More information

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 1 In this chapter, you will learn The basics of texture mapping Texture coordinates Texture objects and texture binding Texture specification

More information

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. Bing-Yu Chen National Taiwan University Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

More information

4 Introduction to OpenGL Programming. Chapter 4. Introduction to OpenGL Programming. Department of Computer Science and Engineering 4-1

4 Introduction to OpenGL Programming. Chapter 4. Introduction to OpenGL Programming. Department of Computer Science and Engineering 4-1 Chapter 4 Introduction to OpenGL Programming 4-1 Overview This chapter is supposed to provide a brief overview of some of the most important features of OpenGL. It will include details that go beyond the

More information

Testing and Operating on Fragments

Testing and Operating on Fragments Additionally, multisampling using sample shading can add a lot more work in computing the color of a pixel. If your system has four samples per pixels, you ve quadrupled the work per pixel in rasterizing

More information

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques Texture Mapping Textures The realism of an image is greatly enhanced by adding surface textures to the various faces of a mesh object. In part a) images have been pasted onto each face of a box. Part b)

More information

A display list is a group of OpenGL commands that have been stored for later execution.

A display list is a group of OpenGL commands that have been stored for later execution. Introduction A display list is a group of OpenGL commands that have been stored for later execution. Most OpenGL commands can be either stored in a display list or issued in immediate mode. 1 For example,

More information

2D Drawing Primitives

2D Drawing Primitives THE SIERPINSKI GASKET We use as a sample problem the drawing of the Sierpinski gasket an interesting shape that has a long history and is of interest in areas such as fractal geometry. The Sierpinski gasket

More information

MB86290 Series 3D Graphics Library V02 User Manual The core API

MB86290 Series 3D Graphics Library V02 User Manual The core API MB86290 Series 3D Graphics Library V02 User Manual The core API Revision 1.0 Copyright FUJITSU LIMITED 1999-2003 ALL RIGHTS RESERVED 1. The specifications in this manual are subject to change without notice.

More information

Image Processing. Geometry Processing. Reading: (Not really covered in our text. See Sects 18.1, 18.2.) Overview: Display

Image Processing. Geometry Processing. Reading: (Not really covered in our text. See Sects 18.1, 18.2.) Overview: Display CMSC 427: Chapter 2 Graphics Libraries and OpenGL Reading: (Not really covered in our text. See Sects 18.1, 18.2.) Overview: Graphics Libraries OpenGL and its Structure Drawing Primitives in OpenGL GLUT

More information

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry INF3320 Computer Graphics and Discrete Geometry The OpenGL pipeline Christopher Dyken and Martin Reimers 07.10.2009 Page 1 The OpenGL pipeline Real Time Rendering: The Graphics Processing Unit (GPU) (Chapter

More information

Lighting and Texturing

Lighting and Texturing Lighting and Texturing Michael Tao Michael Tao Lighting and Texturing 1 / 1 Fixed Function OpenGL Lighting Need to enable lighting Need to configure lights Need to configure triangle material properties

More information

Image Rendering. Rendering can be divided into three sub-problems. Image Formation The hidden surface problem visibility determination steps

Image Rendering. Rendering can be divided into three sub-problems. Image Formation The hidden surface problem visibility determination steps Image Rendering Rendering can be divided into three sub-problems Image Formation The hidden surface problem visibility determination steps Illumination Direct illumination Indirect illumination Shading

More information

CSCI 4620/8626. Computer Graphics Attributes of Graphics Primitives (Chapter 5)

CSCI 4620/8626. Computer Graphics Attributes of Graphics Primitives (Chapter 5) CSCI 4620/8626 Computer Graphics Attributes of Graphics Primitives (Chapter 5) Last update: 2015-03-02 Non-Fill Methods While polygons can be filled (with patterns or colors), they can also be displayed

More information

Lecture 4 of 41. Lab 1a: OpenGL Basics

Lecture 4 of 41. Lab 1a: OpenGL Basics Lab 1a: OpenGL Basics William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://snipurl.com/1y5gc Course web site: http://www.kddresearch.org/courses/cis636 Instructor

More information

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL Today s Agenda Basic design of a graphics system Introduction to OpenGL Image Compositing Compositing one image over another is most common choice can think of each image drawn on a transparent plastic

More information

Lecture 07: Buffers and Textures

Lecture 07: Buffers and Textures Lecture 07: Buffers and Textures CSE 40166 Computer Graphics Peter Bui University of Notre Dame, IN, USA October 26, 2010 OpenGL Pipeline Today s Focus Pixel Buffers: read and write image data to and from

More information

Introduction to Computer Graphics with OpenGL/GLUT

Introduction to Computer Graphics with OpenGL/GLUT Introduction to Computer Graphics with OpenGL/GLUT What is OpenGL? A software interface to graphics hardware Graphics rendering API (Low Level) High-quality color images composed of geometric and image

More information

Computer graphic -- Programming with OpenGL I

Computer graphic -- Programming with OpenGL I Computer graphic -- Programming with OpenGL I A simple example using OpenGL Download the example code "basic shapes", and compile and run it Take a look at it, and hit ESC when you're done. It shows the

More information

Computer Graphics. Making Pictures. Computer Graphics CSC470 1

Computer Graphics. Making Pictures. Computer Graphics CSC470 1 Computer Graphics Making Pictures Computer Graphics CSC470 1 Getting Started Making Pictures Graphics display: Entire screen (a); windows system (b); [both have usual screen coordinates, with y-axis y

More information

三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒

三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒 三維繪圖程式設計 3D Graphics Programming Design 第三章三維繪圖狀態設定和幾何元件繪製嘉大資工系盧天麒 1 In this chapter, you will learn How to access values in the OpenGL state machine The types of primitives available in OpenGL How to

More information

Filled Area Primitives. CEng 477 Introduction to Computer Graphics METU, 2007

Filled Area Primitives. CEng 477 Introduction to Computer Graphics METU, 2007 Filled Area Primitives CEng 477 Introduction to Computer Graphics METU, 2007 Filled Area Primitives Two basic approaches to area filling on raster systems: Determine the overlap intervals for scan lines

More information

CS Computer Graphics: OpenGL, Continued

CS Computer Graphics: OpenGL, Continued CS 543 - Computer Graphics: OpenGL, Continued by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Last time. OpenGL set up Basic structure OpenGL skeleton Callback functions, etc. R.W.

More information

CS Computer Graphics: OpenGL, Continued

CS Computer Graphics: OpenGL, Continued CS 543 - Computer Graphics: OpenGL, Continued by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Last time. OpenGL set up Basic structure OpenGL skeleton Callback functions, etc. R.W.

More information

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry INF3320 Computer Graphics and Discrete Geometry The OpenGL pipeline Christopher Dyken and Martin Reimers 12.10.2011 Page 1 Pipeline operations Page 2 OpenGL fixed-function pipeline: Implements a fixed

More information

CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics CS 543 Lecture 1 (Part 3) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Recall: OpenGL Skeleton void main(int argc, char** argv){ // First initialize

More information

Computer Graphics Course 2005

Computer Graphics Course 2005 Computer Graphics Course 2005 Introduction to GLUT, GLU and OpenGL Administrative Stuff Teaching Assistant: Rony Goldenthal Reception Hour: Wed. 18:00 19:00 Room 31 (Ross 1) Questions: E-mail: cg@cs Newsgroups:

More information

Lectures OpenGL Introduction

Lectures OpenGL Introduction Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is

More information

An Interactive Introduction to OpenGL Programming. An Interactive Introduction to OpenGL Programming. SIGGRAPH New Orleans 1

An Interactive Introduction to OpenGL Programming. An Interactive Introduction to OpenGL Programming. SIGGRAPH New Orleans 1 What You ll See Today OpenGL and GLUT Overview What Is OpenGL? An Interactive Introduction to OpenGL Dave Shreiner Ed Angel General OpenGL Introduction Rendering Primitives Rendering Modes Lighting Mapping

More information

Graphics Pipeline & APIs

Graphics Pipeline & APIs Graphics Pipeline & APIs CPU Vertex Processing Rasterization Fragment Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,

More information

Graphics Pipeline & APIs

Graphics Pipeline & APIs 3 2 4 Graphics Pipeline & APIs CPU Vertex Processing Rasterization Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,

More information

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3 OpenGL Introduction Introduction OpenGL OpenGL is an API for computer graphics. Hardware-independent Windowing or getting input is not included in the API Low-level Only knows about triangles (kind of,

More information

Display Lists. Conceptually similar to a graphics file. In client-server environment, display list is placed on server

Display Lists. Conceptually similar to a graphics file. In client-server environment, display list is placed on server Display Lists Conceptually similar to a graphics file Must define (name, create) Add contents Close In client-server environment, display list is placed on server Can be redisplayed without sending primitives

More information

VR-programming tools (procedural) More VRML later in this course! (declarative)

VR-programming tools (procedural) More VRML later in this course! (declarative) Realtime 3D Computer Graphics & Virtual Reality OpenGL Introduction VR-programming Input and display devices are the main hardware interface to users Immersion embeds users through the generation of live-like

More information

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3) Computer Graphics (Fall 2008) COMS 4160, Lecture 9: OpenGL 1 http://www.cs.columbia.edu/~cs4160 To Do Start thinking (now) about HW 3. Milestones are due soon. Course Course 3D Graphics Pipeline 3D Graphics

More information

GLSL Overview: Creating a Program

GLSL Overview: Creating a Program 1. Create the OpenGL application GLSL Overview: Creating a Program Primarily concerned with drawing Preferred approach uses buffer objects All drawing done in terms of vertex arrays Programming style differs

More information

OpenGL An introduction

OpenGL An introduction OpenGL An introduction Camilla Berglund elmindreda@stacken.kth.se Introductory illustration by theodore This material is under a Creative Commons license http://creativecommons.org/licenses/by-sa/2.5/se/

More information

GEOMETRIC OBJECTS AND TRANSFORMATIONS I

GEOMETRIC OBJECTS AND TRANSFORMATIONS I Computer UNIT Graphics - 4 and Visualization 6 Hrs GEOMETRIC OBJECTS AND TRANSFORMATIONS I Scalars Points, and vectors Three-dimensional primitives Coordinate systems and frames Modelling a colored cube

More information

OpenGL Programming Guide Chapter 8, Drawing Pixels, Bitmaps, Fonts, and Images 1

OpenGL Programming Guide Chapter 8, Drawing Pixels, Bitmaps, Fonts, and Images 1 OpenGL Programming Guide Chapter 8, Drawing Pixels, Bitmaps, Fonts, and Images 1 Chapter 8 Drawing Pixels, Bitmaps, Fonts, and Images Chapter Objectives After reading this chapter, you ll be able to do

More information

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 Reading: See any standard reference on OpenGL or GLUT. Basic Drawing: In the previous lecture, we showed how to create a window in GLUT,

More information

Computer Graphics Primitive Attributes

Computer Graphics Primitive Attributes Computer Graphics 2015 4. Primitive Attributes Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2015-10-12 Previous lessons - Rasterization - line - circle /ellipse? => homework - OpenGL and

More information

cs123 Lab 3 OpenGL Part One 1 Introduction 2 OpenGL Basics 2.2 The Rendering Pipeline 2.1 The CPU and the GPU 2.3 Basic Syntax of OpenGL commands

cs123 Lab 3 OpenGL Part One 1 Introduction 2 OpenGL Basics 2.2 The Rendering Pipeline 2.1 The CPU and the GPU 2.3 Basic Syntax of OpenGL commands cs123 Lab 3 OpenGL Part One Introduction to Computer Graphics 1 Introduction From now on, our weekly labs will focus on the use of OpenGL. While the lectures and projects will let you get a deeper understanding

More information

Exercise 1 Introduction to OpenGL

Exercise 1 Introduction to OpenGL Exercise 1 Introduction to OpenGL What we are going to do OpenGL Glut Small Example using OpenGl and Glut Alexandra Junghans 2 What is OpenGL? OpenGL Two Parts most widely used and supported graphics API

More information

OpenGL. Toolkits.

OpenGL. Toolkits. http://www.opengl.org OpenGL Open Graphics Library Graphics API Delivered with UNIX, Win9x/2000/Me/Nt/Xp, Mac OS Direct3D (DirectX) is only Windows Utilizes the window system and event handling of the

More information

CS559: Computer Graphics. Lecture 12: OpenGL Li Zhang Spring 2008

CS559: Computer Graphics. Lecture 12: OpenGL Li Zhang Spring 2008 CS559: Computer Graphics Lecture 12: OpenGL Li Zhang Spring 2008 Reading Redbook Ch 1 & 2 So far: 3D Geometry Pipeline Model Space (Object Space) Rotation Translation Resizing World Space M Rotation Translation

More information

Computer Graphics 1 Computer Graphics 1

Computer Graphics 1 Computer Graphics 1 Projects: an example Developed by Nate Robbins Shapes Tutorial What is OpenGL? Graphics rendering API high-quality color images composed of geometric and image primitives window system independent operating

More information

Programming of Graphics

Programming of Graphics Peter Mileff PhD Programming of Graphics Introduction to OpenGL University of Miskolc Department of Information Technology OpenGL libraries GL (Graphics Library): Library of 2D, 3D drawing primitives and

More information

Building Models. Prof. George Wolberg Dept. of Computer Science City College of New York

Building Models. Prof. George Wolberg Dept. of Computer Science City College of New York Building Models Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Introduce simple data structures for building polygonal models - Vertex lists - Edge lists Deprecated

More information

Drawing with OpenGL. Chapter 3. Chapter Objectives

Drawing with OpenGL. Chapter 3. Chapter Objectives Chapter 3 Drawing with OpenGL Chapter Objectives After reading this chapter, you will be able to: Identify all of the rendering primitives available in OpenGL. Initialize and populate data buffers for

More information

Introduction to OpenGL

Introduction to OpenGL Introduction to OpenGL 1995-2015 Josef Pelikán & Alexander Wilkie CGG MFF UK Praha pepca@cgg.mff.cuni.cz http://cgg.mff.cuni.cz/~pepca/ 1 / 31 Advances in Hardware 3D acceleration is a common feature in

More information

CS 428: Fall Introduction to. Polygon rendering: additional topics. Andrew Nealen, Rutgers, /14/2009 1

CS 428: Fall Introduction to. Polygon rendering: additional topics. Andrew Nealen, Rutgers, /14/2009 1 CS 428: Fall 2009 Introduction to Computer Graphics Polygon rendering: additional topics Andrew Nealen, Rutgers, 2009 10/14/2009 1 z-buffer algorithm The depth buffer was suggested in 1974 but not implemented

More information

CS 4731 Lecture 3: Introduction to OpenGL and GLUT: Part II. Emmanuel Agu

CS 4731 Lecture 3: Introduction to OpenGL and GLUT: Part II. Emmanuel Agu CS 4731 Lecture 3: Introduction to OpenGL and GLUT: Part II Emmanuel Agu Recall: OpenGL Skeleton void main(int argc, char** argv){ // First initialize toolkit, set display mode and create window glutinit(&argc,

More information

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software

More information

Computer Graphics. OpenGL

Computer Graphics. OpenGL Computer Graphics OpenGL What is OpenGL? OpenGL (Open Graphics Library) is a library for computer graphics It consists of several procedures and functions that allow a programmer to specify the objects

More information

CS 432 Interactive Computer Graphics

CS 432 Interactive Computer Graphics CS 432 Interactive Computer Graphics Lecture 2 Part 1 Primitives and Buffers Matt Burlick - Drexel University - CS 432 1 Rendering in OpenGL Ok, so now we want to actually draw stuff! OpenGL (like most

More information

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 2: First Program

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 2: First Program Comp 410/510 Computer Graphics Spring 2017 Programming with OpenGL Part 2: First Program Objectives Refine the first program Introduce a standard program structure - Initialization Program Structure Most

More information

Imaging and Raster Primitives

Imaging and Raster Primitives Realtime 3D Computer Graphics & Virtual Reality Bitmaps and Textures Imaging and Raster Primitives Vicki Shreiner Imaging and Raster Primitives Describe OpenGL s raster primitives: bitmaps and image rectangles

More information

Shading System Immediate-Mode API v2.2

Shading System Immediate-Mode API v2.2 Shading System Immediate-Mode API v2.2 William R. Mark and C. Philipp Schloter August 29, 2001 1 Introduction This document describes modifications to the OpenGL API to support the immediate-mode use of

More information

How OpenGL Works. Retained Mode. Immediate Mode. Introduction To OpenGL

How OpenGL Works. Retained Mode. Immediate Mode. Introduction To OpenGL How OpenGL Works Introduction To OpenGL OpenGL uses a series of matrices to control the position and way primitives are drawn OpenGL 1.x - 2.x allows these primitives to be drawn in two ways immediate

More information

Announcement. Homework 1 has been posted in dropbox and course website. Due: 1:15 pm, Monday, September 12

Announcement. Homework 1 has been posted in dropbox and course website. Due: 1:15 pm, Monday, September 12 Announcement Homework 1 has been posted in dropbox and course website Due: 1:15 pm, Monday, September 12 Today s Agenda Primitives Programming with OpenGL OpenGL Primitives Polylines GL_POINTS GL_LINES

More information

Computer Graphics, Chapt 08

Computer Graphics, Chapt 08 Computer Graphics, Chapt 08 Creating an Image Components, parts of a scene to be displayed Trees, terrain Furniture, walls Store fronts and street scenes Atoms and molecules Stars and galaxies Describe

More information

Lecture 3 Advanced Computer Graphics (CS & SE )

Lecture 3 Advanced Computer Graphics (CS & SE ) Lecture 3 Advanced Computer Graphics (CS & SE 233.420) Programming with OpenGL Program Structure Primitives Attributes and States Programming in three dimensions Inputs and Interaction Working with Callbacks

More information

Computer Graphics. Chapter 3 Computer Graphics Software

Computer Graphics. Chapter 3 Computer Graphics Software Computer Graphics Chapter 3 Computer Graphics Software Outline Graphics Software Packages Introduction to OpenGL Example Program 2 3 Graphics Software Software packages General Programming Graphics Packages

More information

void drawdot(glint x, GLint y) { glbegin(gl_points); glvertex2i(x,y); glend();

void drawdot(glint x, GLint y) { glbegin(gl_points); glvertex2i(x,y); glend(); CSC 706 Computer Graphics Primitives, Stippling, Fitting In OpenGL Primitives Examples: GL_POINTS GL_LINES GL_LINE_STRIP GL_POLYGON GL_LINE_LOOP GL_ TRIANGLES GL_QUAD_STRIP GL_TRIANGLE_STRIP GL_TRIANGLE_FAN

More information

Lecture 2. Determinants. Ax = 0. a 11 x 1 + a 12 x a 1n x n = 0 a 21 x 1 + a 22 x a 2n x n = 0

Lecture 2. Determinants. Ax = 0. a 11 x 1 + a 12 x a 1n x n = 0 a 21 x 1 + a 22 x a 2n x n = 0 A = a 11 a 12... a 1n a 21 a 22... a 2n. a n1 a n2... a nn x = x 1 x 2. x n Lecture 2 Math Review 2 Introduction to OpenGL Ax = 0 a 11 x 1 + a 12 x 2 +... + a 1n x n = 0 a 21 x 1 + a 22 x 2 +... + a 2n

More information

Rendering. Part 1 An introduction to OpenGL

Rendering. Part 1 An introduction to OpenGL Rendering Part 1 An introduction to OpenGL Olivier Gourmel VORTEX Team IRIT University of Toulouse gourmel@irit.fr Image synthesis The Graphics Processing Unit (GPU): A highly parallel architecture specialized

More information

Vertex Buffer Objects

Vertex Buffer Objects 1 Vertex Buffer Objects This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Mike Bailey mjb@cs.oregonstate.edu VertexBuffers.pptx Vertex Buffer

More information

Vertex Buffer Objects. Vertex Buffer Objects: The Big Idea

Vertex Buffer Objects. Vertex Buffer Objects: The Big Idea 1 Vertex Buffer Objects This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Mike Bailey mjb@cs.oregonstate.edu VertexBuffers.pptx Vertex Buffer

More information

OpenGL Primitives. Examples: Lines. Points. Polylines. void drawdot(glint x, GLint y) { glbegin(gl_points); glvertex2i(x,y); glend(); }

OpenGL Primitives. Examples: Lines. Points. Polylines. void drawdot(glint x, GLint y) { glbegin(gl_points); glvertex2i(x,y); glend(); } CSC 706 Computer Graphics Primitives, Stippling, Fitting In Examples: OpenGL Primitives GL_POINTS GL_LINES LINES GL _ LINE _ STRIP GL_POLYGON GL_LINE_LOOP GL_TRIANGLES GL_QUAD_STRIP GL_TRIANGLE_STRIP GL_TRIANGLE_FAN

More information

CSC 8470 Computer Graphics. What is Computer Graphics?

CSC 8470 Computer Graphics. What is Computer Graphics? CSC 8470 Computer Graphics What is Computer Graphics? For us, it is primarily the study of how pictures can be generated using a computer. But it also includes: software tools used to make pictures hardware

More information

Computer Graphics. Three-Dimensional Graphics VI. Guoying Zhao 1 / 73

Computer Graphics. Three-Dimensional Graphics VI. Guoying Zhao 1 / 73 Computer Graphics Three-Dimensional Graphics VI Guoying Zhao 1 / 73 Texture mapping Guoying Zhao 2 / 73 Objectives Introduce Mapping Methods Texture Mapping Environment Mapping Bump Mapping Consider basic

More information

COURSE 17: STATE-OF-THE-ART IN SHADING HARDWARE1 CHAPTER 6: THE OPENGL SHADING LANGUAGE 2. Randi J. Rost 3Dlabs, Inc.

COURSE 17: STATE-OF-THE-ART IN SHADING HARDWARE1 CHAPTER 6: THE OPENGL SHADING LANGUAGE 2. Randi J. Rost 3Dlabs, Inc. COURSE 17: STATE-OF-THE-ART IN SHADING HARDWARE1 CHAPTER 6: THE OPENGL SHADING LANGUAGE 2 Randi J. Rost 3Dlabs, Inc. SIGGRAPH 2002 Course Notes 05-August-2002 SIGGRAPH 2002 6-1 State of the Art in Shading

More information