Bläddra i källkod

Fix define preparation for detail map

Popov72 5 år sedan
förälder
incheckning
c295007bbb
1 ändrade filer med 11 tillägg och 11 borttagningar
  1. 11 11
      src/Materials/standardMaterial.ts

+ 11 - 11
src/Materials/standardMaterial.ts

@@ -192,7 +192,7 @@ export class StandardMaterial extends PushMaterial {
     /**
      * The detail texture of the material.
      */
-    @expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")
+    @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public detailTexture: Nullable<BaseTexture>;
 
     /**
@@ -864,16 +864,6 @@ export class StandardMaterial extends PushMaterial {
                     defines.DIFFUSE = false;
                 }
 
-                if (this._detailTexture && StandardMaterial.DetailTextureEnabled) {
-                    if (!this._detailTexture.isReadyOrNotBlocking()) {
-                        return false;
-                    } else {
-                        MaterialHelper.PrepareDefinesForMergedUV(this._detailTexture, defines, "DETAIL");
-                    }
-                } else {
-                    defines.DETAIL = false;
-                }
-
                 if (this._ambientTexture && StandardMaterial.AmbientTextureEnabled) {
                     if (!this._ambientTexture.isReadyOrNotBlocking()) {
                         return false;
@@ -995,6 +985,16 @@ export class StandardMaterial extends PushMaterial {
                     defines.BUMP = false;
                 }
 
+                if (scene.getEngine().getCaps().standardDerivatives && this._detailTexture && StandardMaterial.DetailTextureEnabled) {
+                    if (!this._detailTexture.isReadyOrNotBlocking()) {
+                        return false;
+                    } else {
+                        MaterialHelper.PrepareDefinesForMergedUV(this._detailTexture, defines, "DETAIL");
+                    }
+                } else {
+                    defines.DETAIL = false;
+                }
+
                 if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
                     if (!this._refractionTexture.isReadyOrNotBlocking()) {
                         return false;