NAMEglFogf,glFogi,glFogfv,glFogiv- specify fog parametersCSPECIFICATIONvoidglFogf( GLenumpname, GLfloatparam) voidglFogi( GLenumpname, GLintparam)PARAMETERSpnameSpecifies a single-valued fog parameter.GL_FOG_MODE,GL_FOG_DENSITY,GL_FOG_START,GL_FOG_END, andGL_FOG_INDEXare accepted.paramSpecifies the value thatpnamewill be set to.CSPECIFICATIONvoidglFogfv( GLenumpname, const GLfloat *params) voidglFogiv( GLenumpname, const GLint *params)PARAMETERSpnameSpecifies a fog parameter.GL_FOG_MODE,GL_FOG_DENSITY,GL_FOG_START,GL_FOG_END,GL_FOG_INDEX, andGL_FOG_COLORare accepted.paramsSpecifies the value or values to be assigned topname.GL_FOG_COLORrequires an array of four values. All other parameters accept an array containing only a single value.DESCRIPTIONFog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations. To enable and disable fog, callglEnableandglDisablewith argumentGL_FOG.glFogassigns the value or values inparamsto the fog parameter specified bypname. The following values are accepted forpname:GL_FOG_MODEparamsis a single integer or floating- point value that specifies the equation to be used to compute the fog blend factor, f. Three symbolic constants are accepted:GL_LINEAR,GL_EXP, andGL_EXP2. The equations corresponding to these symbolic constants are defined below. The initial fog mode isGL_EXP.GL_FOG_DENSITYparamsis a single integer or floating- point value that specifies density, the fog density used in both exponential fog equations. Only nonnegative densities are accepted. The initial fog density is 1.GL_FOG_STARTparamsis a single integer or floating- point value that specifies start, the near distance used in the linear fog equation. The initial near distance is 0.GL_FOG_ENDparamsis a single integer or floating- point value that specifies end, the far distance used in the linear fog equation. The initial far distance is 1.GL_FOG_INDEXparamsis a single integer or floating- point value that specifies i , the fog color index. The initial fogindex is 0.GL_FOG_COLORparamscontains four integer or floating-point values that specify C , the fog color. Integer values are f mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. After conversion, all color components are clamped to the range [0,1]. The initial fog color is (0, 0, 0, 0). Fog blends a fog color with each rasterized pixel fragment's posttexturing color using a blending factor f. Factor f is computed in one of three ways, depending on the fog mode. Let z be the distance in eye coordinates from the origin to the fragment being fogged. The equation forGL_LINEARfog is f = ___________ end - start The equation forGL_EXPfog is f = e**(-(density . z)) The equation forGL_EXP2fog is f = e**(-(density . z)**2) Regardless of the fog mode, f is clamped to the range [0,1] after it is computed. Then, if the GL is in RGBA color mode, the fragment's color C is replaced by r C ' = fC +(1-f)C r r f In color index mode, the fragment's color index i is replaced by r i ' = i +(1-f)i r r fERRORSGL_INVALID_ENUMis generated ifpnameis not an accepted value, or ifpnameisGL_FOG_MODEandparamsis not an accepted value.GL_INVALID_VALUEis generated ifpnameisGL_FOG_DENSITY, andparamsis negative.GL_INVALID_OPERATIONis generated ifglFogis executed between the execution ofglBeginand the corresponding execution ofglEnd.ASSOCIATEDGETSglIsEnabledwith argumentGL_FOGglGetwith argumentGL_FOG_COLORglGetwith argumentGL_FOG_INDEXglGetwith argumentGL_FOG_DENSITYglGetwith argumentGL_FOG_STARTglGetwith argumentGL_FOG_ENDglGetwith argumentGL_FOG_MODESEEALSOglEnable