1
0

ViewportDepthNode.html 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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"><a href="Node.html">Node</a></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">
  32. <strong>scope</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The node's scope.</p>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td class="name">
  40. <strong>valueNode</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The value node.</p>
  44. <p>Default is <code>null</code>.</p>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. <h2 class="subsection-title">Properties</h2>
  52. <div class="member">
  53. <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>
  54. <div class="description">
  55. <p>This flag can be used for type testing.</p>
  56. <p>Default is <code>true</code>.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'depth' | 'depthBase' | 'linearDepth'</span> </h3>
  61. <div class="description">
  62. <p>The node behaves differently depending on which scope is selected.</p>
  63. <ul>
  64. <li><code>ViewportDepthNode.DEPTH_BASE</code>: Allows to define a value for the current fragment's depth.</li>
  65. <li><code>ViewportDepthNode.DEPTH</code>: Represents the depth value for the current fragment (<code>valueNode</code> is ignored).</li>
  66. <li><code>ViewportDepthNode.LINEAR_DEPTH</code>: Represents the linear (orthographic) depth value of the current fragment.
  67. If a <code>valueNode</code> is set, the scope can be used to convert perspective depth data to linear data.</li>
  68. </ul>
  69. </div>
  70. </div>
  71. <div class="member">
  72. <h3 class="name" id="valueNode" translate="no">.<a href="#valueNode">valueNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  73. <div class="description">
  74. <p>Can be used to define a custom depth value.
  75. The property is ignored in the <code>ViewportDepthNode.DEPTH</code> scope.</p>
  76. <p>Default is <code>null</code>.</p>
  77. </div>
  78. </div>
  79. <h2 class="subsection-title">Source</h2>
  80. <p>
  81. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ViewportDepthNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/ViewportDepthNode.js</a>
  82. </p>
  83. </article>
  84. </section>
  85. <script src="../scripts/linenumber.js"></script>
  86. <script src="../scripts/page.js"></script>
  87. </body>
  88. </html>
粤ICP备19079148号