GLState.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>GL State Constants</h1>
  12. These are used by the WebGLRenderer to set gl.cullFace and gl.frontFace states in the GPU.
  13. <h2>Cull Face Modes</h2>
  14. <code>
  15. THREE.CullFaceNone
  16. </code>
  17. <p>Disable face culling.</p>
  18. <code>
  19. THREE.CullFaceBack
  20. </code>
  21. <p>Cull back faces (default).</p>
  22. <code>
  23. THREE.CullFaceFront
  24. </code>
  25. <p>Cull front faces.</p>
  26. <code>
  27. THREE.CullFaceFrontBack
  28. </code>
  29. <p>Cull both front and back faces.</p>
  30. <h2>Front Face Direction</h2>
  31. Set the winding order for polygons to either clockwise or counter-clockwise (default).
  32. <code>
  33. THREE.FrontFaceDirectionCW
  34. THREE.FrontFaceDirectionCCW
  35. </code>
  36. <h2>Usage</h2>
  37. <code>
  38. var renderer = new THREE.WebGLRenderer();
  39. renderer.setFaceCulling ( THREE.CullFaceBack, THREE.FrontFaceDirectionCCW ); //defaults
  40. </code>
  41. <h2>Source</h2>
  42. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  43. </body>
  44. </html>