提交 b1d1f26b 编写于 作者: M Mr.doob

WebGLRenderer: Removed material.envMap condition from setProgram().

上级 2a5b7717
...@@ -1965,10 +1965,6 @@ function WebGLRenderer( parameters ) { ...@@ -1965,10 +1965,6 @@ function WebGLRenderer( parameters ) {
m_uniforms.color.value.copy( material.color ); m_uniforms.color.value.copy( material.color );
m_uniforms.opacity.value = material.opacity; m_uniforms.opacity.value = material.opacity;
} else if ( material.envMap ) {
refreshUniformsCommon( m_uniforms, material );
} }
// RectAreaLight Texture // RectAreaLight Texture
......
...@@ -88,11 +88,11 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { ...@@ -88,11 +88,11 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
}; };
// enable code injection for non-built-in material // enable code injection for non-built-in material
Object.defineProperty( boxMesh.material, 'map', { Object.defineProperty( boxMesh.material, 'envMap', {
get: function () { get: function () {
return this.envMap.value; return this.uniforms.envMap.value;
} }
...@@ -103,7 +103,9 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { ...@@ -103,7 +103,9 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
} }
var texture = background.isWebGLRenderTargetCube ? background.texture : background; 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 || if ( currentBackground !== background ||
currentBackgroundVersion !== texture.version ) { currentBackgroundVersion !== texture.version ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册