|
@@ -65,6 +65,7 @@ THREE.PMREMGenerator = ( function () {
|
|
|
var PMREMGenerator = function ( renderer ) {
|
|
|
|
|
|
_renderer = renderer;
|
|
|
+ _compileMaterial( _blurMaterial );
|
|
|
|
|
|
};
|
|
|
|
|
@@ -128,6 +129,36 @@ THREE.PMREMGenerator = ( function () {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during
|
|
|
+ * your texture's network fetch for increased concurrency.
|
|
|
+ */
|
|
|
+ compileCubemapShader: function () {
|
|
|
+
|
|
|
+ if ( _cubemapShader == null ) {
|
|
|
+
|
|
|
+ _cubemapShader = _getCubemapShader();
|
|
|
+ _compileMaterial( _cubemapShader );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during
|
|
|
+ * your texture's network fetch for increased concurrency.
|
|
|
+ */
|
|
|
+ compileEquirectangularShader: function () {
|
|
|
+
|
|
|
+ if ( _equirectShader == null ) {
|
|
|
+
|
|
|
+ _equirectShader = _getEquirectShader();
|
|
|
+ _compileMaterial( _equirectShader );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 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
|
|
@@ -359,6 +390,14 @@ THREE.PMREMGenerator = ( function () {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function _compileMaterial( material ) {
|
|
|
+
|
|
|
+ var tmpScene = new THREE.Scene();
|
|
|
+ tmpScene.add( new THREE.Mesh( _lodPlanes[ 0 ], material ) );
|
|
|
+ _renderer.compile( tmpScene, _flatCamera );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
function _createRenderTarget( params ) {
|
|
|
|
|
|
var cubeUVRenderTarget =
|