ViewportDepthNode.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ViewportDepthNode - 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="Node.html">Node</a> → </p>
  13. <h1 translate="no">ViewportDepthNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node offers a collection of features in context of the depth logic in the fragment shader.
  17. Depending on <a href="ViewportDepthNode.html#scope">ViewportDepthNode#scope</a>, it can be used to define a depth value for the current
  18. fragment or for depth evaluation purposes.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="ViewportDepthNode" translate="no">new <a href="#ViewportDepthNode">ViewportDepthNode</a><span class="signature">( scope : <span class="param-type">'depth' | 'depthBase' | 'linearDepth'</span>, valueNode : <span class="param-type">Node</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new viewport depth node.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name"><code>scope</code></td>
  32. <td class="description last"><p>The node's scope.</p></td>
  33. </tr>
  34. <tr>
  35. <td class="name"><code>valueNode</code></td>
  36. <td class="description last"><p>The value node.<br/>Default is <code>null</code>.</p></td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <h2 class="subsection-title">Properties</h2>
  43. <div class="member">
  44. <h3 class="name" id="isViewportDepthNode" translate="no">.<a href="#isViewportDepthNode">isViewportDepthNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  45. <div class="description">
  46. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  47. </div>
  48. </div>
  49. <div class="member">
  50. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'depth' | 'depthBase' | 'linearDepth'</span> </h3>
  51. <div class="description">
  52. <p>The node behaves differently depending on which scope is selected.</p>
  53. <ul>
  54. <li><code>ViewportDepthNode.DEPTH_BASE</code>: Allows to define a value for the current fragment's depth.</li>
  55. <li><code>ViewportDepthNode.DEPTH</code>: Represents the depth value for the current fragment (<code>valueNode</code> is ignored).</li>
  56. <li><code>ViewportDepthNode.LINEAR_DEPTH</code>: Represents the linear (orthographic) depth value of the current fragment.
  57. If a <code>valueNode</code> is set, the scope can be used to convert perspective depth data to linear data.</li>
  58. </ul>
  59. </div>
  60. </div>
  61. <div class="member">
  62. <h3 class="name" id="valueNode" translate="no">.<a href="#valueNode">valueNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  63. <div class="description">
  64. <p>Can be used to define a custom depth value.
  65. The property is ignored in the <code>ViewportDepthNode.DEPTH</code> scope.<br/>Default is <code>null</code>.</p>
  66. </div>
  67. </div>
  68. <h2 class="subsection-title">Source</h2>
  69. <p>
  70. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ViewportDepthNode.js" target="_blank" rel="noopener" translate="no">src/nodes/display/ViewportDepthNode.js</a>
  71. </p>
  72. </article>
  73. </section>
  74. <script src="../scripts/linenumber.js"></script>
  75. <script src="../scripts/page.js"></script>
  76. </body>
  77. </html>
粤ICP备19079148号