module-Bayer.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Bayer - 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. <h1 translate="no">Bayer</h1>
  13. <section>
  14. <header>
  15. </header>
  16. <article>
  17. <h2 class="subsection-title">Import</h2>
  18. <p><span translate="no">Bayer</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>
  19. <pre><code class="language-js">import { bayer16 } from 'three/addons/tsl/math/Bayer.js';</code></pre>
  20. <div class="container-overview">
  21. </div>
  22. <h2 class="subsection-title">Static Methods</h2>
  23. <h3 class="name name-method" id=".bayer16" translate="no">.<a href="#.bayer16">bayer16</a><span class="signature">( uv : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec2></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec4></span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>This TSL function can be used to sample a Bayer16 texture which is a 16x16 texture with a Bayer Matrix pattern.
  27. It can be used for dithering effects but also as an alternative to blue-noise. When used with Ray Marching
  28. specifically in <a href="VolumeNodeMaterial.html#offsetNode">VolumeNodeMaterial#offsetNode</a>, it reduces banding problem, thus being able to use
  29. fewer steps without affecting the visuals as much.</p>
  30. </div>
  31. <table class="params">
  32. <tbody>
  33. <tr>
  34. <td class="name">
  35. <strong>uv</strong>
  36. </td>
  37. <td class="description last">
  38. <p>The uv to sample the bayer16 texture.</p>
  39. </td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. <dl class="details">
  44. <dt class="tag-returns"><strong>Returns:</strong> The sampled bayer value.</dt>
  45. </dl>
  46. </div>
  47. <h2 class="subsection-title">Source</h2>
  48. <p>
  49. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/math/Bayer.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/math/Bayer.js</a>
  50. </p>
  51. </article>
  52. </section>
  53. <script src="../scripts/linenumber.js"></script>
  54. <script src="../scripts/page.js"></script>
  55. </body>
  56. </html>
粤ICP备19079148号