EffectComposer.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. Used to implement post-processing effects in three.js. The class manages a chain of post-processing passes
  13. to produce the final visual result. Post-processing passes are executed in order of their addition/insertion.
  14. The last pass is automatically rendered to screen.
  15. </p>
  16. <h2>Import</h2>
  17. <p>
  18. [name] is an add-on, and must be imported explicitly.
  19. See [link:#manual/introduction/Installation Installation / Addons].
  20. </p>
  21. <code>
  22. import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
  23. </code>
  24. <h2>Examples</h2>
  25. <p>
  26. [example:webgl_postprocessing postprocessing]<br />
  27. [example:webgl_postprocessing_advanced postprocessing advanced]<br />
  28. [example:webgl_postprocessing_backgrounds postprocessing backgrounds]<br />
  29. [example:webgl_postprocessing_transition postprocessing transition]<br />
  30. [example:webgl_postprocessing_dof postprocessing depth-of-field]<br />
  31. [example:webgl_postprocessing_dof2 postprocessing depth-of-field 2]<br />
  32. [example:webgl_postprocessing_fxaa postprocessing fxaa]<br />
  33. [example:webgl_postprocessing_glitch postprocessing glitch]<br />
  34. [example:webgl_postprocessing_godrays postprocessing godrays]<br />
  35. [example:webgl_postprocessing_gtao postprocessing gtao]<br />
  36. [example:webgl_postprocessing_masking postprocessing masking]<br />
  37. [example:webgl_postprocessing_material_ao postprocessing material ao]<br />
  38. [example:webgl_postprocessing_outline postprocessing outline]<br />
  39. [example:webgl_postprocessing_pixel postprocessing pixelate]<br />
  40. [example:webgl_postprocessing_procedural postprocessing procedural]<br />
  41. [example:webgl_postprocessing_rgb_halftone postprocessing rgb halftone]<br />
  42. [example:webgl_postprocessing_sao postprocessing sao]<br />
  43. [example:webgl_postprocessing_smaa postprocessing smaa]<br />
  44. [example:webgl_postprocessing_sobel postprocessing sobel]<br />
  45. [example:webgl_postprocessing_ssaa postprocessing ssaa]<br />
  46. [example:webgl_postprocessing_ssao postprocessing ssao]<br />
  47. [example:webgl_postprocessing_taa postprocessing taa]<br />
  48. [example:webgl_postprocessing_unreal_bloom postprocessing unreal bloom]<br />
  49. [example:webgl_postprocessing_unreal_bloom_selective postprocessing unreal bloom selective]<br />
  50. </p>
  51. <h2>Constructor</h2>
  52. <h3>[name]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget renderTarget] )</h3>
  53. <p>
  54. [page:WebGLRenderer renderer] -- The renderer used to render the scene. <br />
  55. [page:WebGLRenderTarget renderTarget] -- (optional) A preconfigured render target internally used by [name].
  56. </p>
  57. <h2>Properties</h2>
  58. <h3>[property:Array passes]</h3>
  59. <p>
  60. An array representing the (ordered) chain of post-processing passes.
  61. </p>
  62. <h3>[property:WebGLRenderTarget readBuffer]</h3>
  63. <p>
  64. A reference to the internal read buffer. Passes usually read the previous render result from this buffer.
  65. </p>
  66. <h3>[property:WebGLRenderer renderer]</h3>
  67. <p>
  68. A reference to the internal renderer.
  69. </p>
  70. <h3>[property:Boolean renderToScreen]</h3>
  71. <p>
  72. Whether the final pass is rendered to the screen (default framebuffer) or not.
  73. </p>
  74. <h3>[property:WebGLRenderTarget writeBuffer]</h3>
  75. <p>
  76. A reference to the internal write buffer. Passes usually write their result into this buffer.
  77. </p>
  78. <h2>Methods</h2>
  79. <h3>[method:undefined addPass]( [param:Pass pass] )</h3>
  80. <p>
  81. pass -- The pass to add to the pass chain.<br /><br />
  82. Adds the given pass to the pass chain.
  83. </p>
  84. <h3>[method:undefined dispose]()</h3>
  85. <p>
  86. Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
  87. </p>
  88. <h3>[method:undefined insertPass]( [param:Pass pass], [param:Integer index] )</h3>
  89. <p>
  90. pass -- The pass to insert into the pass chain.<br />
  91. index -- Defines the position in the pass chain where the pass should be inserted.<br /><br />
  92. Inserts the given pass into the pass chain at the given index.
  93. </p>
  94. <h3>[method:Boolean isLastEnabledPass]( [param:Integer passIndex] )</h3>
  95. <p>
  96. passIndex -- The pass to check.<br /><br />
  97. Returns true if the pass for the given index is the last enabled pass in the pass chain.
  98. Used by [name] to determine when a pass should be rendered to screen.
  99. </p>
  100. <h3>[method:undefined removePass]( [param:Pass pass] )</h3>
  101. <p>
  102. pass -- The pass to remove from the pass chain.<br /><br />
  103. Removes the given pass from the pass chain.
  104. </p>
  105. <h3>[method:undefined render]( [param:Float deltaTime] )</h3>
  106. <p>
  107. deltaTime -- The delta time value.<br /><br />
  108. Executes all enabled post-processing passes in order to produce the final frame.
  109. </p>
  110. <h3>[method:undefined reset]( [param:WebGLRenderTarget renderTarget] )</h3>
  111. <p>
  112. [page:WebGLRenderTarget renderTarget] -- (optional) A preconfigured render target internally used by [name]..<br /><br />
  113. Resets the internal state of the [name].
  114. </p>
  115. <h3>[method:undefined setPixelRatio]( [param:Float pixelRatio] )</h3>
  116. <p>
  117. pixelRatio -- The device pixel ratio.<br /><br />
  118. Sets device pixel ratio. This is usually used for HiDPI device to prevent blurring output.
  119. Thus, the semantic of the method is similar to [page:WebGLRenderer.setPixelRatio]().
  120. </p>
  121. <h3>[method:undefined setSize]( [param:Integer width], [param:Integer height] )</h3>
  122. <p>
  123. width -- The width of the [name].<br />
  124. height -- The height of the [name].<br /><br />
  125. Resizes the internal render buffers and passes to (width, height) with device pixel ratio taken into account.
  126. Thus, the semantic of the method is similar to [page:WebGLRenderer.setSize]().
  127. </p>
  128. <h3>[method:undefined swapBuffers]()</h3>
  129. <p>Swaps the internal read/write buffers.</p>
  130. <h2>Source</h2>
  131. <p>
  132. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/EffectComposer.js examples/jsm/postprocessing/EffectComposer.js]
  133. </p>
  134. </body>
  135. </html>