|
@@ -230,9 +230,9 @@ PMREMGenerator.prototype = {
|
|
|
magFilter: NearestFilter,
|
|
|
minFilter: NearestFilter,
|
|
|
generateMipmaps: false,
|
|
|
- type: equirectangular ? equirectangular.type : UnsignedByteType,
|
|
|
- format: equirectangular ? equirectangular.format : RGBEFormat,
|
|
|
- encoding: equirectangular ? equirectangular.encoding : RGBEEncoding,
|
|
|
+ type: UnsignedByteType,
|
|
|
+ format: RGBEFormat,
|
|
|
+ encoding: _isLDR( equirectangular ) ? equirectangular.encoding : RGBEEncoding,
|
|
|
depthBuffer: false,
|
|
|
stencilBuffer: false
|
|
|
};
|
|
@@ -358,7 +358,7 @@ PMREMGenerator.prototype = {
|
|
|
}
|
|
|
|
|
|
uniforms[ 'inputEncoding' ].value = ENCODINGS[ texture.encoding ];
|
|
|
- uniforms[ 'outputEncoding' ].value = ENCODINGS[ texture.encoding ];
|
|
|
+ uniforms[ 'outputEncoding' ].value = ENCODINGS[ cubeUVRenderTarget.texture.encoding ];
|
|
|
|
|
|
_setViewport( cubeUVRenderTarget, 0, 0, 3 * SIZE_MAX, 2 * SIZE_MAX );
|
|
|
|
|
@@ -505,6 +505,14 @@ PMREMGenerator.prototype = {
|
|
|
|
|
|
};
|
|
|
|
|
|
+function _isLDR( texture ) {
|
|
|
+
|
|
|
+ if ( texture === undefined || texture.type !== UnsignedByteType ) return false;
|
|
|
+
|
|
|
+ return texture.encoding === LinearEncoding || texture.encoding === sRGBEncoding || texture.encoding === GammaEncoding;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
function _createPlanes() {
|
|
|
|
|
|
var _lodPlanes = [];
|