From 7a2f944a235e8c27141c5fb15675827d7f858b5d Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Sat, 25 Jan 2020 14:39:06 +0100 Subject: [PATCH] Docs: Add missing pages for ImageUtils and PMREMGenerator. --- docs/api/en/extras/ImageUtils.html | 32 +++++++++++ docs/api/en/extras/PMREMGenerator.html | 80 ++++++++++++++++++++++++++ docs/api/zh/extras/ImageUtils.html | 32 +++++++++++ docs/api/zh/extras/PMREMGenerator.html | 80 ++++++++++++++++++++++++++ docs/list.js | 6 +- 5 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 docs/api/en/extras/ImageUtils.html create mode 100644 docs/api/en/extras/PMREMGenerator.html create mode 100644 docs/api/zh/extras/ImageUtils.html create mode 100644 docs/api/zh/extras/PMREMGenerator.html diff --git a/docs/api/en/extras/ImageUtils.html b/docs/api/en/extras/ImageUtils.html new file mode 100644 index 00000000000000..1f850372034bee --- /dev/null +++ b/docs/api/en/extras/ImageUtils.html @@ -0,0 +1,32 @@ + + + + + + + + + + +

[name]

+ +

+ A class containing utility functions for images. +

+ +

Methods

+ +

[method:String getDataURL]( [param:HTMLCanvasElement image] | [param:HTMLImageElement image] | [param:ImageBitmap image] )

+

+ image -- The image object.

+ + Returns a data URI containing a representation of the given image. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/en/extras/PMREMGenerator.html b/docs/api/en/extras/PMREMGenerator.html new file mode 100644 index 00000000000000..e5fa7605922cdc --- /dev/null +++ b/docs/api/en/extras/PMREMGenerator.html @@ -0,0 +1,80 @@ + + + + + + + + + + +

[name]

+ +

+ This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture. + This allows different levels of blur to be quickly accessed based on material roughness. It is packed into a special + CubeUV format that allows us to perform custom interpolation so that we can support nonlinear formats such as RGBE. + Unlike a traditional mipmap chain, it only goes down to the LOD_MIN level (above), and then creates extra even more + filtered 'mips' at the same LOD_MIN resolution, associated with higher roughness levels. In this way we maintain + resolution to smoothly interpolate diffuse lighting while limiting sampling computation. +

+ +

Constructor

+ +

[name]( [param:WebGLRenderer renderer] )

+

+ This constructor creates a new [name]. +

+ +

Methods

+ +

[method:WebGLRenderTarget fromScene]( [param:Scene scene], [param:Number sigma], [param:Number near], [param:Number far] )

+

+ [page:Scene scene] - The given scene.
+ [page:Number sigma] - (optional) Specifies a blur radius in radians to be applied to the scene before PMREM generation. Default is *0*.
+ [page:Number near] - (optional) The near plane value. Default is *0.1*.
+ [page:Number far] - (optional) The far plane value. Default is *100*.

+ + Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low. + Optional near and far planes ensure the scene is rendered in its entirety (the cubeCamera is placed at the origin). +

+ +

[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangular] )

+

+ [page:Texture equirectangular] - The equirectangular texture.

+ + Generates a PMREM from an equirectangular texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat). + The ideal input image size is 1k (1024 x 512), as this matches best with the 256 x 256 cubemap output. +

+ +

[method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] )

+

+ [page:CubeTexture cubemap] - The cubemap texture.

+ + Generates a PMREM from an cubemap texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat). + The ideal input cube size is 256 x 256, as this matches best with the 256 x 256 cubemap output. +

+ +

[method:void compileCubemapShader]()

+

+ Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency. +

+ +

[method:void compileEquirectangularShader]()

+

+ Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency. +

+ +

[method:void dispose]()

+

+ Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, so you should not need more than one + PMREMGenerator object. If you do, calling dispose() on one of them will cause any others to also become unusable. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/zh/extras/ImageUtils.html b/docs/api/zh/extras/ImageUtils.html new file mode 100644 index 00000000000000..1f850372034bee --- /dev/null +++ b/docs/api/zh/extras/ImageUtils.html @@ -0,0 +1,32 @@ + + + + + + + + + + +

[name]

+ +

+ A class containing utility functions for images. +

+ +

Methods

+ +

[method:String getDataURL]( [param:HTMLCanvasElement image] | [param:HTMLImageElement image] | [param:ImageBitmap image] )

+

+ image -- The image object.

+ + Returns a data URI containing a representation of the given image. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/api/zh/extras/PMREMGenerator.html b/docs/api/zh/extras/PMREMGenerator.html new file mode 100644 index 00000000000000..e5fa7605922cdc --- /dev/null +++ b/docs/api/zh/extras/PMREMGenerator.html @@ -0,0 +1,80 @@ + + + + + + + + + + +

[name]

+ +

+ This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture. + This allows different levels of blur to be quickly accessed based on material roughness. It is packed into a special + CubeUV format that allows us to perform custom interpolation so that we can support nonlinear formats such as RGBE. + Unlike a traditional mipmap chain, it only goes down to the LOD_MIN level (above), and then creates extra even more + filtered 'mips' at the same LOD_MIN resolution, associated with higher roughness levels. In this way we maintain + resolution to smoothly interpolate diffuse lighting while limiting sampling computation. +

+ +

Constructor

+ +

[name]( [param:WebGLRenderer renderer] )

+

+ This constructor creates a new [name]. +

+ +

Methods

+ +

[method:WebGLRenderTarget fromScene]( [param:Scene scene], [param:Number sigma], [param:Number near], [param:Number far] )

+

+ [page:Scene scene] - The given scene.
+ [page:Number sigma] - (optional) Specifies a blur radius in radians to be applied to the scene before PMREM generation. Default is *0*.
+ [page:Number near] - (optional) The near plane value. Default is *0.1*.
+ [page:Number far] - (optional) The far plane value. Default is *100*.

+ + Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low. + Optional near and far planes ensure the scene is rendered in its entirety (the cubeCamera is placed at the origin). +

+ +

[method:WebGLRenderTarget fromEquirectangular]( [param:Texture equirectangular] )

+

+ [page:Texture equirectangular] - The equirectangular texture.

+ + Generates a PMREM from an equirectangular texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat). + The ideal input image size is 1k (1024 x 512), as this matches best with the 256 x 256 cubemap output. +

+ +

[method:WebGLRenderTarget fromCubemap]( [param:CubeTexture cubemap] )

+

+ [page:CubeTexture cubemap] - The cubemap texture.

+ + Generates a PMREM from an cubemap texture, which can be either LDR (RGBFormat) or HDR (RGBEFormat). + The ideal input cube size is 256 x 256, as this matches best with the 256 x 256 cubemap output. +

+ +

[method:void compileCubemapShader]()

+

+ Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency. +

+ +

[method:void compileEquirectangularShader]()

+

+ Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency. +

+ +

[method:void dispose]()

+

+ Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, so you should not need more than one + PMREMGenerator object. If you do, calling dispose() on one of them will cause any others to also become unusable. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] +

+ + diff --git a/docs/list.js b/docs/list.js index 311af6d959027e..9395b77bb56a02 100644 --- a/docs/list.js +++ b/docs/list.js @@ -111,7 +111,9 @@ var list = { "Extras": { "Earcut": "api/en/extras/Earcut", - "ShapeUtils": "api/en/extras/ShapeUtils" + "ImageUtils": "api/en/extras/ImageUtils", + "PMREMGenerator": "api/en/extras/PMREMGenerator", + "ShapeUtils": "api/en/extras/ShapeUtils", }, "Extras / Core": { @@ -561,6 +563,8 @@ var list = { "附件": { "Earcut": "api/zh/extras/Earcut", + "ImageUtils": "api/zh/extras/ImageUtils", + "PMREMGenerator": "api/zh/extras/PMREMGenerator", "ShapeUtils": "api/zh/extras/ShapeUtils" },