EffectComposer.html 5.4 KB

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