WebGLRenderTarget.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. Default is `1`.<br />
  21. [page:Float height] - The height of the renderTarget. Default is `1`.<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 />
  37. [page:Number samples] - default is 0.<br /><br />
  38. Creates a new [name]
  39. </p>
  40. <h2>Properties</h2>
  41. <h3>[property:Boolean isWebGLRenderTarget]</h3>
  42. <p>
  43. Read-only flag to check if a given object is of type [name].
  44. </p>
  45. <h3>[property:number width]</h3>
  46. <p>
  47. The width of the render target.
  48. </p>
  49. <h3>[property:number height]</h3>
  50. <p>
  51. The height of the render target.
  52. </p>
  53. <h3>[property:Vector4 scissor]</h3>
  54. <p>
  55. A rectangular area inside the render target's viewport. Fragments that are outside the area will be discarded.
  56. </p>
  57. <h3>[property:Boolean scissorTest]</h3>
  58. <p>
  59. Indicates whether the scissor test is active or not.
  60. </p>
  61. <h3>[property:Vector4 viewport]</h3>
  62. <p>
  63. The viewport of this render target.
  64. </p>
  65. <h3>[property:Texture texture]</h3>
  66. <p>
  67. This texture instance holds the rendered pixels. Use it as input for further processing.
  68. </p>
  69. <h3>[property:Boolean depthBuffer]</h3>
  70. <p>
  71. Renders to the depth buffer. Default is true.
  72. </p>
  73. <h3>[property:Boolean stencilBuffer]</h3>
  74. <p>
  75. Renders to the stencil buffer. Default is false.
  76. </p>
  77. <h3>[property:DepthTexture depthTexture]</h3>
  78. <p>
  79. If set, the scene depth will be rendered to this texture. Default is null.
  80. </p>
  81. <h3>[property:Number samples]</h3>
  82. <p>
  83. Defines the count of MSAA samples. Can only be used with WebGL 2. Default is `0`.
  84. </p>
  85. <h2>Methods</h2>
  86. <h3>[method:undefined setSize]( [param:Number width], [param:Number height] )</h3>
  87. <p>
  88. Sets the size of the render target.
  89. </p>
  90. <h3>[method:WebGLRenderTarget clone]()</h3>
  91. <p>
  92. Creates a copy of this render target.
  93. </p>
  94. <h3>[method:this copy]( [param:WebGLRenderTarget source] )</h3>
  95. <p>
  96. Adopts the settings of the given render target.
  97. </p>
  98. <h3>[method:undefined dispose]()</h3>
  99. <p>
  100. Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
  101. </p>
  102. <p>[page:EventDispatcher EventDispatcher] methods are available on this class.</p>
  103. <h2>Source</h2>
  104. <p>
  105. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  106. </p>
  107. </body>
  108. </html>