1
0

DebugEnvironment.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>DebugEnvironment - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Object3D.html">Object3D</a> → <a href="Scene.html">Scene</a> → </p>
  13. <h1 translate="no">DebugEnvironment</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class represents a scene with a very basic room setup that can be used as
  17. input for <a href="PMREMGenerator.html#fromScene">PMREMGenerator#fromScene</a>. The resulting PMREM represents the room's
  18. lighting and can be used for Image Based Lighting by assigning it to <a href="Scene.html#environment">Scene#environment</a>
  19. or directly as an environment map to PBR materials.</p>
  20. <p>This class uses a simple room setup and should only be used for development purposes.
  21. A more appropriate setup for production is <a href="RoomEnvironment.html">RoomEnvironment</a>.</p></div>
  22. <h2>Code Example</h2>
  23. <div translate="no"><pre><code class="language-js">const environment = new DebugEnvironment();
  24. const pmremGenerator = new THREE.PMREMGenerator( renderer );
  25. const envMap = pmremGenerator.fromScene( environment ).texture;
  26. scene.environment = envMap;
  27. </code></pre></div>
  28. </header>
  29. <article>
  30. <h2 class="subsection-title">Import</h2>
  31. <p><span translate="no">DebugEnvironment</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  32. <pre><code class="language-js">import { DebugEnvironment } from 'three/addons/environments/DebugEnvironment.js';</code></pre>
  33. <div class="container-overview">
  34. <h2>Constructor</h2>
  35. <h3 class="name name-method" id="DebugEnvironment" translate="no">new <a href="#DebugEnvironment">DebugEnvironment</a><span class="signature">()</span> </h3>
  36. <div class="method">
  37. <div class="description">
  38. <p>Constructs a new debug environment.</p>
  39. </div>
  40. </div>
  41. </div>
  42. <h2 class="subsection-title">Methods</h2>
  43. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  44. <div class="method">
  45. <div class="description">
  46. <p>Frees internal resources. This method should be called
  47. when the environment is no longer required.</p>
  48. </div>
  49. </div>
  50. <h2 class="subsection-title">Source</h2>
  51. <p>
  52. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/environments/DebugEnvironment.js" translate="no" target="_blank" rel="noopener">examples/jsm/environments/DebugEnvironment.js</a>
  53. </p>
  54. </article>
  55. </section>
  56. <script src="../scripts/linenumber.js"></script>
  57. <script src="../scripts/page.js"></script>
  58. </body>
  59. </html>
粤ICP备19079148号