|
@@ -89,19 +89,19 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
|
|
|
|
|
|
let encoding;
|
|
|
|
|
|
- if ( ! map ) {
|
|
|
-
|
|
|
- encoding = LinearEncoding;
|
|
|
-
|
|
|
- } else if ( map.isTexture ) {
|
|
|
+ if ( map && map.isTexture ) {
|
|
|
|
|
|
encoding = map.encoding;
|
|
|
|
|
|
- } else if ( map.isWebGLRenderTarget ) {
|
|
|
+ } else if ( map && map.isWebGLRenderTarget ) {
|
|
|
|
|
|
console.warn( 'THREE.WebGLPrograms.getTextureEncodingFromMap: don\'t use render targets as textures. Use their .texture property instead.' );
|
|
|
encoding = map.texture.encoding;
|
|
|
|
|
|
+ } else {
|
|
|
+
|
|
|
+ encoding = LinearEncoding;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return encoding;
|