ShadowingTypes.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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>Shadowing Type Constants</h1>
  12. <p>These define the shadow map types used by the WebGLRenderer.</p>
  13. <h2>Shadow Map Types</h2>
  14. <code>
  15. THREE.BasicShadowMap
  16. </code>
  17. <p>Unfiltered shadow maps - fastest, but lowest quality.</p>
  18. <code>
  19. THREE.PCFShadowMap
  20. </code>
  21. <p>Shadow maps filtered using the Percentage-Closer Filtering (PCF) algorithm (default).</p>
  22. <code>
  23. THREE.PCFSoftShadowMap
  24. </code>
  25. <p>Shadow maps filtered using the Percentage-Closer Soft Shadows (PCSS) algorithm.</p>
  26. <h2>Usage</h2>
  27. <code>
  28. var renderer = new THREE.WebGLRenderer();
  29. renderer.shadowMap.enabled = true;
  30. renderer.shadowMap.type = THREE.PCFShadowMap; //default
  31. </code>
  32. Note that this just enables shadows in the renderer and sets the shadow map type. <br />
  33. To actually cast shadows you will have to set up shadows for the any light you want to cast shadows, and for meshes you want to cast / receive shadows. <br />
  34. <h2>Source</h2>
  35. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  36. </body>
  37. </html>