2
0

WebGLRenderTarget.html 4.3 KB

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