|
|
@@ -135,6 +135,7 @@ class PMREMGenerator {
|
|
|
* @param {Number} [far=100] - The far plane distance.
|
|
|
* @param {RenderTarget?} [renderTarget=null] - The render target to use.
|
|
|
* @return {RenderTarget} The resulting PMREM.
|
|
|
+ * @see fromSceneAsync
|
|
|
*/
|
|
|
fromScene( scene, sigma = 0, near = 0.1, far = 100, renderTarget = null ) {
|
|
|
|
|
|
@@ -175,6 +176,21 @@ class PMREMGenerator {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Generates a PMREM from a supplied Scene, which can be faster than using an
|
|
|
+ * image if networking bandwidth is low. Optional sigma specifies a blur radius
|
|
|
+ * in radians to be applied to the scene before PMREM generation. Optional near
|
|
|
+ * and far planes ensure the scene is rendered in its entirety (the cubeCamera
|
|
|
+ * is placed at the origin).
|
|
|
+ *
|
|
|
+ * @param {Scene} scene - The scene to be captured.
|
|
|
+ * @param {Number} [sigma=0] - The blur radius in radians.
|
|
|
+ * @param {Number} [near=0.1] - The near plane distance.
|
|
|
+ * @param {Number} [far=100] - The far plane distance.
|
|
|
+ * @param {RenderTarget?} [renderTarget=null] - The render target to use.
|
|
|
+ * @return {Promise<RenderTarget>} The resulting PMREM.
|
|
|
+ * @see fromScene
|
|
|
+ */
|
|
|
async fromSceneAsync( scene, sigma = 0, near = 0.1, far = 100, renderTarget = null ) {
|
|
|
|
|
|
if ( this._hasInitialized === false ) await this._renderer.init();
|
|
|
@@ -191,6 +207,7 @@ class PMREMGenerator {
|
|
|
* @param {Texture} equirectangular - The equirectangular texture to be converted.
|
|
|
* @param {RenderTarget?} [renderTarget=null] - The render target to use.
|
|
|
* @return {RenderTarget} The resulting PMREM.
|
|
|
+ * @see fromEquirectangularAsync
|
|
|
*/
|
|
|
fromEquirectangular( equirectangular, renderTarget = null ) {
|
|
|
|
|
|
@@ -212,6 +229,16 @@ class PMREMGenerator {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Generates a PMREM from an equirectangular texture, which can be either LDR
|
|
|
+ * or HDR. The ideal input image size is 1k (1024 x 512),
|
|
|
+ * as this matches best with the 256 x 256 cubemap output.
|
|
|
+ *
|
|
|
+ * @param {Texture} equirectangular - The equirectangular texture to be converted.
|
|
|
+ * @param {RenderTarget?} [renderTarget=null] - The render target to use.
|
|
|
+ * @return {Promise<RenderTarget>} The resulting PMREM.
|
|
|
+ * @see fromEquirectangular
|
|
|
+ */
|
|
|
async fromEquirectangularAsync( equirectangular, renderTarget = null ) {
|
|
|
|
|
|
if ( this._hasInitialized === false ) await this._renderer.init();
|
|
|
@@ -228,6 +255,7 @@ class PMREMGenerator {
|
|
|
* @param {Texture} cubemap - The cubemap texture to be converted.
|
|
|
* @param {RenderTarget?} [renderTarget=null] - The render target to use.
|
|
|
* @return {RenderTarget} The resulting PMREM.
|
|
|
+ * @see fromCubemapAsync
|
|
|
*/
|
|
|
fromCubemap( cubemap, renderTarget = null ) {
|
|
|
|
|
|
@@ -249,6 +277,16 @@ class PMREMGenerator {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Generates a PMREM from an cubemap texture, which can be either LDR
|
|
|
+ * or HDR. The ideal input cube size is 256 x 256,
|
|
|
+ * with the 256 x 256 cubemap output.
|
|
|
+ *
|
|
|
+ * @param {Texture} cubemap - The cubemap texture to be converted.
|
|
|
+ * @param {RenderTarget?} [renderTarget=null] - The render target to use.
|
|
|
+ * @return {Promise<RenderTarget>} The resulting PMREM.
|
|
|
+ * @see fromCubemap
|
|
|
+ */
|
|
|
async fromCubemapAsync( cubemap, renderTarget = null ) {
|
|
|
|
|
|
if ( this._hasInitialized === false ) await this._renderer.init();
|
|
|
@@ -260,6 +298,8 @@ class PMREMGenerator {
|
|
|
/**
|
|
|
* Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during
|
|
|
* your texture's network fetch for increased concurrency.
|
|
|
+ *
|
|
|
+ * @returns {Promise}
|
|
|
*/
|
|
|
async compileCubemapShader() {
|
|
|
|
|
|
@@ -275,6 +315,8 @@ class PMREMGenerator {
|
|
|
/**
|
|
|
* Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during
|
|
|
* your texture's network fetch for increased concurrency.
|
|
|
+ *
|
|
|
+ * @returns {Promise}
|
|
|
*/
|
|
|
async compileEquirectangularShader() {
|
|
|
|