PMREMGenerator.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. This class generates a Prefiltered, Mipmapped Radiance Environment Map
  13. (PMREM) from a cubeMap environment texture. This allows different levels
  14. of blur to be quickly accessed based on material roughness. Unlike a
  15. traditional mipmap chain, it only goes down to the LOD_MIN level (above),
  16. and then creates extra even more filtered 'mips' at the same LOD_MIN
  17. resolution, associated with higher roughness levels. In this way we
  18. maintain resolution to smoothly interpolate diffuse lighting while
  19. limiting sampling computation.<br /><br />
  20. Note: The minimum [page:MeshStandardMaterial]'s roughness depends on the
  21. size of the provided texture. If your render has small dimensions or the
  22. shiny parts have a lot of curvature, you may still be able to get away
  23. with a smaller texture size.
  24. </p>
  25. <table>
  26. <tr>
  27. <th>texture size</th>
  28. <td>minimum roughness</td>
  29. </tr>
  30. <tr>
  31. <td>16</td>
  32. <td>0.21</td>
  33. </tr>
  34. <tr>
  35. <td>32</td>
  36. <td>0.15</td>
  37. </tr>
  38. <tr>
  39. <td>64</td>
  40. <td>0.11</td>
  41. </tr>
  42. <tr>
  43. <td>128</td>
  44. <td>0.076</td>
  45. </tr>
  46. <tr>
  47. <td>256</td>
  48. <td>0.054</td>
  49. </tr>
  50. <tr>
  51. <td>512</td>
  52. <td>0.038</td>
  53. </tr>
  54. <tr>
  55. <td>1024</td>
  56. <td>0.027</td>
  57. </tr>
  58. </table>
  59. <h2>Constructor</h2>
  60. <h3>[name]( [param:WebGLRenderer renderer] )</h3>
  61. <p>This constructor creates a new [name].</p>
  62. <h2>Methods</h2>
  63. <h3>
  64. [method:WebGLRenderTarget fromScene]( [param:Scene scene], [param:Number sigma], [param:Number near], [param:Number far], [param:Object options] )
  65. </h3>
  66. <p>
  67. [page:Scene scene] - The given scene.<br />
  68. [page:Number sigma] - (optional) Specifies a blur radius in radians to be
  69. applied to the scene before PMREM generation. Default is `0`.<br />
  70. [page:Number near] - (optional) The near plane value. Default is `0.1`.<br />
  71. [page:Number far] - (optional) The far plane value. Default is `100`.<br />
  72. [page:Object options] - (optional) The configuration options. It allows to define
  73. the `size` of the PMREM as a number well as the `position` of the internal cube camera as
  74. an instance of `Vector3`.<br /><br />
  75. Generates a PMREM from a supplied Scene, which can be faster than using an
  76. image if networking bandwidth is low. Optional near and far planes ensure
  77. the scene is rendered in its entirety.
  78. </p>
  79. <h3>
  80. [method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangular] )
  81. </h3>
  82. <p>
  83. [page:Texture equirectangular] - The equirectangular texture.<br /><br />
  84. Generates a PMREM from an equirectangular texture.
  85. </p>
  86. <h3>
  87. [method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] )
  88. </h3>
  89. <p>
  90. [page:CubeTexture cubemap] - The cubemap texture.<br /><br />
  91. Generates a PMREM from an cubemap texture.
  92. </p>
  93. <h3>[method:undefined compileCubemapShader]()</h3>
  94. <p>
  95. Pre-compiles the cubemap shader. You can get faster start-up by invoking
  96. this method during your texture's network fetch for increased concurrency.
  97. </p>
  98. <h3>[method:undefined compileEquirectangularShader]()</h3>
  99. <p>
  100. Pre-compiles the equirectangular shader. You can get faster start-up by
  101. invoking this method during your texture's network fetch for increased
  102. concurrency.
  103. </p>
  104. <h3>[method:undefined dispose]()</h3>
  105. <p>
  106. Frees the GPU-related resources allocated by this instance. Call this
  107. method whenever this instance is no longer used in your app.
  108. </p>
  109. <h2>Source</h2>
  110. <p>
  111. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  112. </p>
  113. </body>
  114. </html>
粤ICP备19079148号