MeshPostProcessingMaterial.html 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>MeshPostProcessingMaterial - 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="Material.html">Material</a> → <a href="MeshStandardMaterial.html">MeshStandardMaterial</a> → <a href="MeshPhysicalMaterial.html">MeshPhysicalMaterial</a> → </p>
  13. <h1 translate="no">MeshPostProcessingMaterial</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>The aim of this mesh material is to use information from a post processing pass in the diffuse color pass.
  17. This material is based on the MeshPhysicalMaterial.</p>
  18. <p>In the current state, only the information of a screen space AO pass can be used in the material.
  19. Actually, the output of any screen space AO (SSAO, GTAO) can be used,
  20. as it is only necessary to provide the AO in one color channel of a texture,
  21. however the AO pass must be rendered prior to the color pass,
  22. which makes the post-processing pass somewhat of a pre-processing pass.
  23. Fot this purpose a new map (<code>aoPassMap</code>) is added to the material.
  24. The value of the map is used the same way as the <code>aoMap</code> value.</p>
  25. <p>Motivation to use the outputs AO pass directly in the material:
  26. The incident light of a fragment is composed of ambient light, direct light and indirect light
  27. Ambient Occlusion only occludes ambient light and environment light, but not direct light.
  28. Direct light is only occluded by geometry that casts shadows.
  29. And of course the emitted light should not be darkened by ambient occlusion either.
  30. This cannot be achieved if the AO post processing pass is simply blended with the diffuse render pass.</p>
  31. <p>Further extension work might be to use the output of an SSR pass or an HBIL pass from a previous frame.
  32. This would then create the possibility of SSR and IR depending on material properties such as <code>roughness</code>, <code>metalness</code> and <code>reflectivity</code>.</p></div>
  33. </header>
  34. <article>
  35. <h2 class="subsection-title">Import</h2>
  36. <p><span translate="no">MeshPostProcessingMaterial</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>
  37. <pre><code class="language-js">import { MeshPostProcessingMaterial } from 'three/addons/materials/MeshPostProcessingMaterial.js';</code></pre>
  38. <div class="container-overview">
  39. <h2>Constructor</h2>
  40. <h3 class="name name-method" id="MeshPostProcessingMaterial" translate="no">new <a href="#MeshPostProcessingMaterial">MeshPostProcessingMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  41. <div class="method">
  42. <div class="description">
  43. <p>Constructs a new conditional line material.</p>
  44. </div>
  45. <table class="params">
  46. <tbody>
  47. <tr>
  48. <td class="name">
  49. <strong>parameters</strong>
  50. </td>
  51. <td class="description last">
  52. <p>An object with one or more properties
  53. defining the material's appearance. Any property of the material
  54. (including any property from inherited materials) can be passed
  55. in here. Color values can be passed any type of value accepted
  56. by <a href="Color.html#set">Color#set</a>.</p>
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Properties</h2>
  64. <div class="member">
  65. <h3 class="name" id="aoPassMap" translate="no">.<a href="#aoPassMap">aoPassMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  66. <div class="description">
  67. <p>A texture representing the AO pass.</p>
  68. </div>
  69. </div>
  70. <div class="member">
  71. <h3 class="name" id="aoPassMapScale" translate="no">.<a href="#aoPassMapScale">aoPassMapScale</a><span class="type-signature"> : number</span> </h3>
  72. <div class="description">
  73. <p>The scale of the AO pass.</p>
  74. <p>Default is <code>1</code>.</p>
  75. </div>
  76. </div>
  77. <h2 class="subsection-title">Source</h2>
  78. <p>
  79. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/materials/MeshPostProcessingMaterial.js" translate="no" target="_blank" rel="noopener">examples/jsm/materials/MeshPostProcessingMaterial.js</a>
  80. </p>
  81. </article>
  82. </section>
  83. <script src="../scripts/linenumber.js"></script>
  84. <script src="../scripts/page.js"></script>
  85. </body>
  86. </html>
粤ICP备19079148号