|
@@ -88,11 +88,11 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
|
|
|
};
|
|
|
|
|
|
// enable code injection for non-built-in material
|
|
|
- Object.defineProperty( boxMesh.material, 'map', {
|
|
|
+ Object.defineProperty( boxMesh.material, 'envMap', {
|
|
|
|
|
|
get: function () {
|
|
|
|
|
|
- return this.envMap.value;
|
|
|
+ return this.uniforms.envMap.value;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -103,7 +103,9 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
|
|
|
}
|
|
|
|
|
|
var texture = background.isWebGLRenderTargetCube ? background.texture : background;
|
|
|
- boxMesh.material.envMap = texture;
|
|
|
+
|
|
|
+ boxMesh.material.uniforms.envMap.value = texture;
|
|
|
+ boxMesh.material.uniforms.flipEnvMap.value = texture.isCubeTexture ? - 1 : 1;
|
|
|
|
|
|
if ( currentBackground !== background ||
|
|
|
currentBackgroundVersion !== texture.version ) {
|