|
@@ -1934,7 +1934,11 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
uniforms.opacity.value = material.opacity;
|
|
|
|
|
|
- uniforms.diffuse.value = material.color;
|
|
|
+ if ( material.color ) {
|
|
|
+
|
|
|
+ uniforms.diffuse.value = material.color;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if ( material.emissive ) {
|
|
|
|
|
@@ -1942,9 +1946,38 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- uniforms.map.value = material.map;
|
|
|
- uniforms.specularMap.value = material.specularMap;
|
|
|
- uniforms.alphaMap.value = material.alphaMap;
|
|
|
+ if ( material.map ) {
|
|
|
+
|
|
|
+ uniforms.map.value = material.map;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( material.alphaMap ) {
|
|
|
+
|
|
|
+ uniforms.alphaMap.value = material.alphaMap;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( material.specularMap ) {
|
|
|
+
|
|
|
+ uniforms.specularMap.value = material.specularMap;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( material.envMap ) {
|
|
|
+
|
|
|
+ uniforms.envMap.value = material.envMap;
|
|
|
+
|
|
|
+ // don't flip CubeTexture envMaps, flip everything else:
|
|
|
+ // WebGLRenderTargetCube will be flipped for backwards compatibility
|
|
|
+ // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture
|
|
|
+ // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future
|
|
|
+ uniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1;
|
|
|
+
|
|
|
+ uniforms.reflectivity.value = material.reflectivity;
|
|
|
+ uniforms.refractionRatio.value = material.refractionRatio;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if ( material.lightMap ) {
|
|
|
|
|
@@ -2024,17 +2057,6 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- uniforms.envMap.value = material.envMap;
|
|
|
-
|
|
|
- // don't flip CubeTexture envMaps, flip everything else:
|
|
|
- // WebGLRenderTargetCube will be flipped for backwards compatibility
|
|
|
- // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture
|
|
|
- // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future
|
|
|
- uniforms.flipEnvMap.value = ( ! ( material.envMap && material.envMap.isCubeTexture ) ) ? 1 : - 1;
|
|
|
-
|
|
|
- uniforms.reflectivity.value = material.reflectivity;
|
|
|
- uniforms.refractionRatio.value = material.refractionRatio;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function refreshUniformsLine( uniforms, material ) {
|