shademodel.3gl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. '\" te
  2. '\"! tbl|eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 24 September 1999
  6. .ds Re Release 1.2.1
  7. .ds Dp Jan 14 18:30
  8. .ds Dm 01 shademode
  9. .ds Xs 4246 5 shademodel.gl
  10. .TH GLSHADEMODEL 3G
  11. .SH NAME
  12. .B "glShadeModel
  13. \- select flat or smooth shading
  14. .SH C SPECIFICATION
  15. void \f3glShadeModel\fP(
  16. GLenum \fImode\fP )
  17. .nf
  18. .fi
  19. .EQ
  20. delim $$
  21. .EN
  22. .SH PARAMETERS
  23. .TP \w'\f2mode\fP\ \ 'u
  24. \f2mode\fP
  25. Specifies a symbolic value representing a shading technique.
  26. Accepted values are \%\f3GL_FLAT\fP and \%\f3GL_SMOOTH\fP.
  27. The initial value is \%\f3GL_SMOOTH\fP.
  28. .SH DESCRIPTION
  29. GL primitives can have either flat or smooth shading.
  30. Smooth shading,
  31. the default,
  32. causes the computed colors of vertices to be interpolated as the
  33. primitive is rasterized,
  34. typically assigning different colors to each resulting pixel fragment.
  35. Flat shading selects the computed color of just one vertex
  36. and assigns it to all the pixel fragments
  37. generated by rasterizing a single primitive.
  38. In either case, the computed color of a vertex is the result of
  39. lighting if lighting is enabled,
  40. or it is the current color at the time the vertex was specified if
  41. lighting is disabled.
  42. .P
  43. Flat and smooth shading are indistinguishable for points.
  44. Starting when \%\f3glBegin\fP is issued and counting vertices and
  45. primitives from 1, the GL gives each flat-shaded line segment $i$ the
  46. computed color of vertex $i ~+~ 1$, its second vertex.
  47. Counting similarly from 1,
  48. the GL gives each flat-shaded polygon the computed color of the vertex listed
  49. in the following table.
  50. This is the last vertex to specify the polygon in all cases except single
  51. polygons,
  52. where the first vertex specifies the flat-shaded color.
  53. .sp
  54. .TS
  55. center;
  56. lb cb
  57. l c .
  58. _
  59. Primitive Type of Polygon $i$ Vertex
  60. _
  61. Single polygon ($ i ~==~ 1 $) 1
  62. Triangle strip $i ~+~ 2$
  63. Triangle fan $i ~+~ 2$
  64. Independent triangle $ 3 i$
  65. Quad strip $2 i ~+~ 2$
  66. Independent quad $ 4 i $
  67. _
  68. .TE
  69. .sp
  70. Flat and smooth shading are specified by \%\f3glShadeModel\fP with \f2mode\fP set to
  71. \%\f3GL_FLAT\fP and \%\f3GL_SMOOTH\fP, respectively.
  72. .SH ERRORS
  73. \%\f3GL_INVALID_ENUM\fP is generated if \f2mode\fP is any value other than
  74. \%\f3GL_FLAT\fP or \%\f3GL_SMOOTH\fP.
  75. .P
  76. \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glShadeModel\fP
  77. is executed between the execution of \%\f3glBegin\fP
  78. and the corresponding execution of \%\f3glEnd\fP.
  79. .SH ASSOCIATED GETS
  80. \%\f3glGet\fP with argument \%\f3GL_SHADE_MODEL\fP
  81. .SH SEE ALSO
  82. \%\f3glBegin(3G)\fP,
  83. \%\f3glColor(3G)\fP,
  84. \%\f3glLight(3G)\fP,
  85. \%\f3glLightModel(3G)\fP