SobelOperatorNode.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SobelOperatorNode - 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> → <a href="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">SobelOperatorNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Post processing node for detecting edges with a sobel filter.
  17. A sobel filter should be applied after tone mapping and output color
  18. space conversion.</p></div>
  19. </header>
  20. <article>
  21. <h2 class="subsection-title">Import</h2>
  22. <p><span translate="no">SobelOperatorNode</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  23. <pre><code class="language-js">import { sobel } from 'three/addons/tsl/display/SobelOperatorNode.js';</code></pre>
  24. <div class="container-overview">
  25. <h2>Constructor</h2>
  26. <h3 class="name name-method" id="SobelOperatorNode" translate="no">new <a href="#SobelOperatorNode">SobelOperatorNode</a><span class="signature">( textureNode : <span class="param-type">TextureNode</span> )</span> </h3>
  27. <div class="method">
  28. <div class="description">
  29. <p>Constructs a new sobel operator node.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name"><code>textureNode</code></td>
  35. <td class="description last"><p>The texture node that represents the input of the effect.</p></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. </div>
  41. <h2 class="subsection-title">Properties</h2>
  42. <div class="member">
  43. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  44. <div class="description">
  45. <p>The texture node that represents the input of the effect.</p>
  46. </div>
  47. </div>
  48. <div class="member">
  49. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  50. <div class="description">
  51. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node updates
  52. its internal uniforms once per frame in <code>updateBefore()</code>.<br/>Default is <code>'frame'</code>.</p>
  53. </div>
  54. <dl class="details">
  55. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  56. </dl>
  57. </div>
  58. <h2 class="subsection-title">Methods</h2>
  59. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : ShaderCallNodeInternal</span> </h3>
  60. <div class="method">
  61. <div class="description">
  62. <p>This method is used to setup the effect's TSL code.</p>
  63. </div>
  64. <table class="params">
  65. <tbody>
  66. <tr>
  67. <td class="name"><code>builder</code></td>
  68. <td class="description last"><p>The current node builder.</p></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <dl class="details">
  73. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  74. </dl>
  75. <dl class="details">
  76. <dt class="tag-returns"><strong>Returns:</strong> </dt>
  77. </dl>
  78. </div>
  79. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type">NodeFrame</span> )</span> </h3>
  80. <div class="method">
  81. <div class="description">
  82. <p>This method is used to update the effect's uniforms once per frame.</p>
  83. </div>
  84. <table class="params">
  85. <tbody>
  86. <tr>
  87. <td class="name"><code>frame</code></td>
  88. <td class="description last"><p>The current node frame.</p></td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. <dl class="details">
  93. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  94. </dl>
  95. </div>
  96. <h2 class="subsection-title">Source</h2>
  97. <p>
  98. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SobelOperatorNode.js" target="_blank" rel="noopener" translate="no">examples/jsm/tsl/display/SobelOperatorNode.js</a>
  99. </p>
  100. </article>
  101. </section>
  102. <script src="../scripts/linenumber.js"></script>
  103. <script src="../scripts/page.js"></script>
  104. </body>
  105. </html>
粤ICP备19079148号