WebGLRenderTarget.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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:Constant format] - default is [page:Textures RGBAFormat]. <br />
  31. [page:Constant type] - default is [page:Textures UnsignedByteType]. <br />
  32. [page:Number anisotropy] - default is *1*. See [page:Texture.anisotropy]<br />
  33. [page:Constant encoding] - default is [page:Textures LinearEncoding]. <br />
  34. [page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it. <br />
  35. [page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.<br /><br />
  36. Creates a new [name]
  37. </p>
  38. <h2>Properties</h2>
  39. <h3>[property:number width]</h3>
  40. <p>
  41. The width of the render target.
  42. </p>
  43. <h3>[property:number height]</h3>
  44. <p>
  45. The height of the render target.
  46. </p>
  47. <h3>[property:Vector4 scissor]</h3>
  48. <p>
  49. A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
  50. </p>
  51. <h3>[property:Boolean scissorTest]</h3>
  52. <p>
  53. Indicates whether the scissor test is active or not.
  54. </p>
  55. <h3>[property:Vector4 viewport]</h3>
  56. <p>
  57. The viewport of this render target.
  58. </p>
  59. <h3>[property:Texture texture]</h3>
  60. <p>
  61. This texture instance holds the rendered pixels. Use it as input for further processing.
  62. </p>
  63. <h3>[property:Boolean depthBuffer]</h3>
  64. <p>
  65. Renders to the depth buffer. Default is true.
  66. </p>
  67. <h3>[property:Boolean stencilBuffer]</h3>
  68. <p>
  69. Renders to the stencil buffer. Default is false.
  70. </p>
  71. <h3>[property:DepthTexture depthTexture]</h3>
  72. <p>
  73. If set, the scene depth will be rendered to this texture. Default is null.
  74. </p>
  75. <h2>Methods</h2>
  76. <h3>[method:null setSize]( [param:Number width], [param:Number height] )</h3>
  77. <p>
  78. Sets the size of the render target.
  79. </p>
  80. <h3>[method:WebGLRenderTarget clone]()</h3>
  81. <p>
  82. Creates a copy of this render target.
  83. </p>
  84. <h3>[method:WebGLRenderTarget copy]( [param:WebGLRenderTarget source] )</h3>
  85. <p>
  86. Adopts the settings of the given render target.
  87. </p>
  88. <h3>[method:null dispose]()</h3>
  89. <p>
  90. Dispatches a dispose event.
  91. </p>
  92. <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
  93. <h2>Source</h2>
  94. <p>
  95. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  96. </p>
  97. </body>
  98. </html>