SobelOperatorNode.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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" rel="noopener">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"><a href="TextureNode.html">TextureNode</a></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">
  35. <strong>textureNode</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The texture node that represents the input of the effect.</p>
  39. </td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  48. <div class="description">
  49. <p>The texture node that represents the input of the effect.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  54. <div class="description">
  55. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node updates
  56. its internal uniforms once per frame in <code>updateBefore()</code>.</p>
  57. <p>Default is <code>'frame'</code>.</p>
  58. </div>
  59. <dl class="details">
  60. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  61. </dl>
  62. </div>
  63. <h2 class="subsection-title">Methods</h2>
  64. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : ShaderCallNodeInternal</span> </h3>
  65. <div class="method">
  66. <div class="description">
  67. <p>This method is used to setup the effect's TSL code.</p>
  68. </div>
  69. <table class="params">
  70. <tbody>
  71. <tr>
  72. <td class="name">
  73. <strong>builder</strong>
  74. </td>
  75. <td class="description last">
  76. <p>The current node builder.</p>
  77. </td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. <dl class="details">
  82. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  83. </dl>
  84. </div>
  85. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  86. <div class="method">
  87. <div class="description">
  88. <p>This method is used to update the effect's uniforms once per frame.</p>
  89. </div>
  90. <table class="params">
  91. <tbody>
  92. <tr>
  93. <td class="name">
  94. <strong>frame</strong>
  95. </td>
  96. <td class="description last">
  97. <p>The current node frame.</p>
  98. </td>
  99. </tr>
  100. </tbody>
  101. </table>
  102. <dl class="details">
  103. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  104. </dl>
  105. </div>
  106. <h2 class="subsection-title">Source</h2>
  107. <p>
  108. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/SobelOperatorNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/SobelOperatorNode.js</a>
  109. </p>
  110. </article>
  111. </section>
  112. <script src="../scripts/linenumber.js"></script>
  113. <script src="../scripts/page.js"></script>
  114. </body>
  115. </html>
粤ICP备19079148号