|
@@ -171,22 +171,25 @@ export class MixMaterial extends PushMaterial {
|
|
|
|
|
|
// Textures
|
|
|
if (scene.texturesEnabled) {
|
|
|
- if (!this._mixTexture1 || !this._mixTexture1.isReady()) {
|
|
|
+ if (this._mixTexture1 && this._mixTexture1.isReady()) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
defines._needUVs = true;
|
|
|
|
|
|
- if (!this._mixTexture2 || !this._mixTexture2.isReady()) {
|
|
|
+ if (this._mixTexture2 && this._mixTexture2.isReady()) {
|
|
|
return false;
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
defines.MIXMAP2 = true;
|
|
|
}
|
|
|
|
|
|
- if (MaterialFlags.DiffuseTextureEnabled) {
|
|
|
+ if (MaterialFlags.DiffuseTextureEnabled) {
|
|
|
if (!this._diffuseTexture1 || !this._diffuseTexture1.isReady()) {
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ defines.DIFFUSE = true;
|
|
|
+
|
|
|
if (!this._diffuseTexture2 || !this._diffuseTexture2.isReady()) {
|
|
|
return false;
|
|
|
}
|
|
@@ -195,10 +198,7 @@ export class MixMaterial extends PushMaterial {
|
|
|
}
|
|
|
if (!this._diffuseTexture4 || !this._diffuseTexture4.isReady()) {
|
|
|
return false;
|
|
|
- }
|
|
|
-
|
|
|
- defines.DIFFUSE = true;
|
|
|
-
|
|
|
+ }
|
|
|
if (!this._diffuseTexture5 || !this._diffuseTexture5.isReady()) {
|
|
|
return false;
|
|
|
}
|
|
@@ -210,11 +210,9 @@ export class MixMaterial extends PushMaterial {
|
|
|
}
|
|
|
if (!this._diffuseTexture8 || !this._diffuseTexture8.isReady()) {
|
|
|
return false;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
// Misc.
|
|
|
MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
|