WebGLRenderTarget.html 4.0 KB

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