WebGLRenderTarget.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. A [link:https://webglfundamentals.org/webgl/lessons/webgl-render-to-texture.html render target] is a buffer
  13. where the video card draws pixels for a scene that is being rendered in the background.
  14. It is used in different effects, such as applying postprocessing to a rendered image
  15. before displaying it on the screen.
  16. </p>
  17. <h2>Constructor</h2>
  18. <h3>[name]([param:Number width], [param:Number height], [param:Object options])</h3>
  19. <p>
  20. [page:Float width] - The width of the renderTarget. <br />
  21. [page:Float height] - The height of the renderTarget.<br />
  22. options - (optional object that holds texture parameters for an auto-generated target
  23. texture and depthBuffer/stencilBuffer booleans.
  24. For an explanation of the texture parameters see [page:Texture Texture]. The following are
  25. valid options:<br /><br />
  26. [page:Constant wrapS] - default is [page:Textures ClampToEdgeWrapping]. <br />
  27. [page:Constant wrapT] - default is [page:Textures ClampToEdgeWrapping]. <br />
  28. [page:Constant magFilter] - default is [page:Textures LinearFilter]. <br />
  29. [page:Constant minFilter] - default is [page:Textures LinearFilter]. <br />
  30. [page:Boolean generateMipmaps] - default is *false*.<br />
  31. [page:Constant format] - default is [page:Textures RGBAFormat]. <br />
  32. [page:Constant type] - default is [page:Textures UnsignedByteType]. <br />
  33. [page:Number anisotropy] - default is *1*. See [page:Texture.anisotropy]<br />
  34. [page:Constant encoding] - default is [page:Textures LinearEncoding]. <br />
  35. [page:Boolean depthBuffer] - default is *true*. <br />
  36. [page:Boolean stencilBuffer] - default is *false*.<br /><br />
  37. Creates a new [name]
  38. </p>
  39. <h2>Properties</h2>
  40. <h3>[property:number width]</h3>
  41. <p>
  42. The width of the render target.
  43. </p>
  44. <h3>[property:number height]</h3>
  45. <p>
  46. The height of the render target.
  47. </p>
  48. <h3>[property:Vector4 scissor]</h3>
  49. <p>
  50. A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
  51. </p>
  52. <h3>[property:Boolean scissorTest]</h3>
  53. <p>
  54. Indicates whether the scissor test is active or not.
  55. </p>
  56. <h3>[property:Vector4 viewport]</h3>
  57. <p>
  58. The viewport of this render target.
  59. </p>
  60. <h3>[property:Texture texture]</h3>
  61. <p>
  62. This texture instance holds the rendered pixels. Use it as input for further processing.
  63. </p>
  64. <h3>[property:Boolean depthBuffer]</h3>
  65. <p>
  66. Renders to the depth buffer. Default is true.
  67. </p>
  68. <h3>[property:Boolean stencilBuffer]</h3>
  69. <p>
  70. Renders to the stencil buffer. Default is false.
  71. </p>
  72. <h3>[property:DepthTexture depthTexture]</h3>
  73. <p>
  74. If set, the scene depth will be rendered to this texture. Default is null.
  75. </p>
  76. <h2>Methods</h2>
  77. <h3>[method:null setSize]( [param:Number width], [param:Number height] )</h3>
  78. <p>
  79. Sets the size of the render target.
  80. </p>
  81. <h3>[method:WebGLRenderTarget clone]()</h3>
  82. <p>
  83. Creates a copy of this render target.
  84. </p>
  85. <h3>[method:WebGLRenderTarget copy]( [param:WebGLRenderTarget source] )</h3>
  86. <p>
  87. Adopts the settings of the given render target.
  88. </p>
  89. <h3>[method:null dispose]()</h3>
  90. <p>
  91. Dispatches a dispose event.
  92. </p>
  93. <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
  94. <h2>Source</h2>
  95. <p>
  96. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  97. </p>
  98. </body>
  99. </html>