EffectComposer.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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>Examples</h2>
  17. <p>
  18. [example:webgl_postprocessing postprocessing]<br />
  19. [example:webgl_postprocessing_advanced postprocessing advanced]<br />
  20. [example:webgl_postprocessing_backgrounds postprocessing backgrounds]<br />
  21. [example:webgl_postprocessing_crossfade postprocessing crossfade]<br />
  22. [example:webgl_postprocessing_dof postprocessing depth-of-field]<br />
  23. [example:webgl_postprocessing_dof2 postprocessing depth-of-field 2]<br />
  24. [example:webgl_postprocessing_fxaa postprocessing fxaa]<br />
  25. [example:webgl_postprocessing_glitch postprocessing glitch]<br />
  26. [example:webgl_postprocessing_godrays postprocessing godrays]<br />
  27. [example:webgl_postprocessing_masking postprocessing masking]<br />
  28. [example:webgl_postprocessing_nodes postprocessing node material]<br />
  29. [example:webgl_postprocessing_outline postprocessing outline]<br />
  30. [example:webgl_postprocessing_pixel postprocessing pixelate]<br />
  31. [example:webgl_postprocessing_procedural postprocessing procedural]<br />
  32. [example:webgl_postprocessing_rgb_halftone postprocessing rgb halftone]<br />
  33. [example:webgl_postprocessing_sao postprocessing sao]<br />
  34. [example:webgl_postprocessing_smaa postprocessing smaa]<br />
  35. [example:webgl_postprocessing_sobel postprocessing sobel]<br />
  36. [example:webgl_postprocessing_ssaa postprocessing ssaa]<br />
  37. [example:webgl_postprocessing_ssao postprocessing ssao]<br />
  38. [example:webgl_postprocessing_taa postprocessing taa]<br />
  39. [example:webgl_postprocessing_unreal_bloom postprocessing unreal bloom]<br />
  40. [example:webgl_postprocessing_unreal_bloom_selective postprocessing unreal bloom selective]<br />
  41. </p>
  42. <h2>Constructor</h2>
  43. <h3>[name]( [param:WebGLRenderer renderer], [param:WebGLRenderTarget renderTarget] )</h3>
  44. <p>
  45. [page:WebGLRenderer renderer] -- The renderer used to render the scene. <br />
  46. [page:WebGLRenderTarget renderTarget] -- (optional) A preconfigured render target internally used by [name].
  47. </p>
  48. <h2>Properties</h2>
  49. <h3>[property:Array passes]</h3>
  50. <p>
  51. An array representing the (ordered) chain of post-processing passes.
  52. </p>
  53. <h3>[property:WebGLRendererTarget readBuffer]</h3>
  54. <p>
  55. A reference to the internal read buffer. Passes usually read the previous render result from this buffer.
  56. </p>
  57. <h3>[property:WebGLRenderer renderer]</h3>
  58. <p>
  59. A reference to the internal renderer.
  60. </p>
  61. <h3>[property:Boolean renderToScreen]</h3>
  62. <p>
  63. Whether the final pass is rendered to the screen (default framebuffer) or not.
  64. </p>
  65. <h3>[property:WebGLRendererTarget writeBuffer]</h3>
  66. <p>
  67. A reference to the internal write buffer. Passes usually write their result into this buffer.
  68. </p>
  69. <h2>Methods</h2>
  70. <h3>[method:void addPass]( [param:Pass pass] )</h3>
  71. <p>
  72. pass -- The pass to add to the pass chain.<br /><br />
  73. Adds the given pass to the pass chain.
  74. </p>
  75. <h3>[method:void insertPass]( [param:Pass pass], [param:Integer index] )</h3>
  76. <p>
  77. pass -- The pass to insert into the pass chain.<br />
  78. index -- Defines the position in the pass chain where the pass should be inserted.<br /><br />
  79. Inserts the given pass into the pass chain at the given index.
  80. </p>
  81. <h3>[method:Boolean isLastEnabledPass]( [param:Integer passIndex] )</h3>
  82. <p>
  83. passIndex -- The pass to check.<br /><br />
  84. Returns true if the pass for the given index is the last enabled pass in the pass chain.
  85. Used by [name] to determine when a pass should be rendered to screen.
  86. </p>
  87. <h3>[method:void removePass]( [param:Pass pass] )</h3>
  88. <p>
  89. pass -- The pass to remove from the pass chain.<br /><br />
  90. Removes the given pass from the pass chain.
  91. </p>
  92. <h3>[method:void render]( [param:Float deltaTime] )</h3>
  93. <p>
  94. deltaTime -- The delta time value.<br /><br />
  95. Executes all enabled post-processing passes in order to produce the final frame.
  96. </p>
  97. <h3>[method:void reset]( [param:WebGLRenderTarget renderTarget] )</h3>
  98. <p>
  99. [page:WebGLRenderTarget renderTarget] -- (optional) A preconfigured render target internally used by [name]..<br /><br />
  100. Resets the internal state of the [name].
  101. </p>
  102. <h3>[method:void setPixelRatio]( [param:Float pixelRatio] )</h3>
  103. <p>
  104. pixelRatio -- The device pixel ratio.<br /><br />
  105. Sets device pixel ratio. This is usually used for HiDPI device to prevent blurring output.
  106. Thus, the semantic of the method is similar to [page:WebGLRenderer.setPixelRatio]().
  107. </p>
  108. <h3>[method:void setSize]( [param:Integer width], [param:Integer height] )</h3>
  109. <p>
  110. width -- The width of the [name].<br />
  111. height -- The height of the [name].<br /><br />
  112. Resizes the internal render buffers and passes to (width, height) with device pixel ratio taken into account.
  113. Thus, the semantic of the method is similar to [page:WebGLRenderer.setSize]().
  114. </p>
  115. <h3>[method:void swapBuffers]()</h3>
  116. <p>Swaps the internal read/write buffers.</p>
  117. <h2>Source</h2>
  118. <p>
  119. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/EffectComposer.js examples/jsm/postprocessing/EffectComposer.js]
  120. </p>
  121. </body>
  122. </html>