module-Bayer.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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">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">Node.&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"><code>uv</code></td>
  35. <td class="description last"><p>The uv to sample the bayer16 texture.</p></td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. <dl class="details">
  40. <dt class="tag-returns"><strong>Returns:</strong> The sampled bayer value.</dt>
  41. </dl>
  42. </div>
  43. <h2 class="subsection-title">Source</h2>
  44. <p>
  45. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/math/Bayer.js" target="_blank" rel="noopener" translate="no">examples/jsm/tsl/math/Bayer.js</a>
  46. </p>
  47. </article>
  48. </section>
  49. <script src="../scripts/linenumber.js"></script>
  50. <script src="../scripts/page.js"></script>
  51. </body>
  52. </html>
粤ICP备19079148号