*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> OpenGL/glfragmentlightmodel (3)              
Title
Content
Arch
Section
 

Contents


glFragmentLightModel(3G)       OpenGL Reference	      glFragmentLightModel(3G)


NAME    [Toc]    [Back]

     glFragmentLightModelfSGIX,	glFragmentLightModeliSGIX,
     glFragmentLightModelfvSGIX, glFragmentLightModelivSGIX - set the lighting
     model parameters

C SPECIFICATION    [Toc]    [Back]

     void glFragmentLightModelfSGIX( GLenum pname,
				     GLfloat param )
     void glFragmentLightModeliSGIX( GLenum pname,
				     GLint param )

PARAMETERS    [Toc]    [Back]

     pname   Specifies a single-valued lighting	model parameter.
	     GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX,
	     GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX,	and
	     GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX are accepted.

     param   Specifies the value that param will be set	to.

C SPECIFICATION    [Toc]    [Back]

     void glFragmentLightModelfvSGIX( GLenum pname,
				      const GLfloat *params )
     void glFragmentLightModelivSGIX( GLenum pname,
				      const GLint *params )

PARAMETERS    [Toc]    [Back]

     pname
	  Specifies a lighting model parameter.
	  GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX,
	  GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX,
	  GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX, and
	  GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX	are accepted.

     params
	  Specifies a pointer to the value or values that params will be set
	  to.

DESCRIPTION    [Toc]    [Back]

     glFragmentLightModel sets the lighting model parameter.  pname names a
     parameter and params gives	the new	value.	There are three	lighting model
     parameters:

     GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX    [Toc]    [Back]
	       params contains four integer or floating-point values that
	       specify the ambient RGBA	intensity of the entire	scene.
	       Integer values are 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.	 Neither integer nor floating-point values are



									Page 1






glFragmentLightModel(3G)       OpenGL Reference	      glFragmentLightModel(3G)



	       clamped.	 The initial ambient scene intensity is	(0.2, 0.2,
	       0.2, 1.0).

     GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX    [Toc]    [Back]
	       params is a single integer or floating-point value that
	       specifies how specular reflection angles	are computed.  If
	       params is 0 (or 0.0), specular reflection angles	take the view
	       direction to be parallel	to and in the direction	of the -z
	       axis, regardless	of the location	of the fragment	in eye
	       coordinates.  Otherwise,	specular reflections are computed from
	       the origin of the eye coordinate	system.	 The initial value is
	       0.

     GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX    [Toc]    [Back]
	       params must be either GL_FLAT or	GL_SMOOTH, and controls	how
	       normals are selected for	use in the fragment lighting
	       computations.  If GL_FLAT is selected for the lighting model,
	       the normal from the provoking vertex of the primitive is	used
	       for all fragment	lighting computations.	If GL_SMOOTH is
	       specified a normal is computed for each fragment	using the
	       normals from all	of the vertices	of the primitive.

     GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX    [Toc]    [Back]
	       params is a single integer or floating-point value that
	       specifies whether one- or two-sided lighting calculations are
	       done for	polygons.  It has no effect on the lighting
	       calculations for	points,	lines, or bitmaps.  If params is 0 (or
	       0.0), one-sided lighting	is specified, and only the front
	       material	parameters are used in the lighting equation.
	       Otherwise, two-sided lighting is	specified.  In this case,
	       vertices	of back-facing polygons	are lighted using the back
	       material	parameters, and	have their normals reversed before the
	       lighting	equation is evaluated.	Vertices of front-facing
	       polygons	are always lighted using the front material
	       parameters, with	no change to their normals. The	initial	value
	       is 0.

     In	RGBA mode, the lighted color of	a fragment is the sum of the material
     emission intensity, the product of	the material ambient reflectance and
     the lighting model	full-scene ambient intensity, and the contribution of
     each enabled light	source.	 Each light source contributes the sum of
     three terms:  ambient, diffuse, and specular.  The	ambient	light source
     contribution is the product of the	material ambient reflectance and the
     light's ambient intensity.	 The diffuse light source contribution is the
     product of	the material diffuse reflectance, the light's diffuse
     intensity,	and the	dot product of the fragment's normal with the
     normalized	vector from the	fragment to the	light source.  The specular
     light source contribution is the product of the material specular
     reflectance, the light's specular intensity, and the dot product of the
     normalized	fragment-to-eye	and fragment-to-light vectors, raised to the
     power of the shininess of the material.  All three	light source
     contributions are attenuated equally based	on the distance	from the



									Page 2






glFragmentLightModel(3G)       OpenGL Reference	      glFragmentLightModel(3G)



     fragment to the light source and on light source direction, spread
     exponent, and spread cutoff angle.	 All dot products are replaced with 0
     if	they evaluate to a negative value.

     The alpha component of the	resulting lighted color	is set to the alpha
     value of the material diffuse reflectance.

     In	color index mode, the value of the lighted index of a fragment ranges
     from the ambient to the specular values passed to glFragmentMaterial
     using GL_COLOR_INDEXES.  Diffuse and specular coefficients, computed with
     a (.30, .59, .11) weighting of the	lights'	colors,	the shininess of the
     material, and the same reflection and attenuation equations as in the
     RGBA case,	determine how much above ambient the resulting index is.

ERRORS    [Toc]    [Back]

     GL_INVALID_ENUM is	generated if pname is not an accepted value.

     GL_INVALID_OPERATION is generated if glFragmentLightModel is executed
     between the execution of glBegin and the corresponding execution of
     glEnd.

ASSOCIATED GETS    [Toc]    [Back]

     glGet with	argument GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX
     glGet with	argument GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX
     glGet with	argument GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX
     glGet with	argument GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX
     glIsEnabled with argument GL_FRAGMENT_LIGHTING_SGIX


MACHINE	DEPENDENCIES
     The SGIX_fragment_lighting	extension is supported only on Octane2 VPro
     systems.

     On	Octane2	VPro systems, use of the texture q coordinate to achieve
     projective	texture	effects	will be	processed on a per-vertex basis
     instead of	a per-pixel basis, unless the the texture matrix is set	up to
     be	projective.  (A	projective texture matrix is defined to	be one in
     which any of the 13th, 14th or 15th elements is non-zero.)	 In addition,
     if	either two-sided lighting or fragment lighting is in effect,
     projective	texture	effects	will always be processed on a per-vertex
     basis.

SEE ALSO    [Toc]    [Back]

      
      
     glFragmentLight, glFragmentMaterial


									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
glMateriali Tru64 specify material parameters for the lighting model
glMaterialf Tru64 specify material parameters for the lighting model
glmaterial IRIX specify material parameters for the lighting model
glMaterial Tru64 specify material parameters for the lighting model
glMaterialfv Tru64 specify material parameters for the lighting model
glMaterialiv Tru64 specify material parameters for the lighting model
glfragmentmaterial IRIX specify fragment material parameters for the fragment lighting model
lmbind IRIX selects a new material, light source, or lighting model
lmdef IRIX defines or modifies a material, light source, or lighting model
numeric IRIX 0- return scalar values related to parameters of an associated model
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service