1
0

WebGLRenderTarget.html 4.9 KB

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