Bladeren bron

Fix generateMip vs noMipMap

David Catuhe 8 jaren geleden
bovenliggende
commit
5f7c072660
24 gewijzigde bestanden met toevoegingen van 10374 en 10373 verwijderingen
  1. 1712 1713
      dist/preview release/babylon.d.ts
  2. 31 31
      dist/preview release/babylon.js
  3. 5 6
      dist/preview release/babylon.max.js
  4. 1712 1713
      dist/preview release/babylon.module.d.ts
  5. 32 32
      dist/preview release/babylon.worker.js
  6. 3287 3287
      dist/preview release/customConfigurations/minimalViewer/babylon.d.ts
  7. 20 20
      dist/preview release/customConfigurations/minimalViewer/babylon.js
  8. 3287 3287
      dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts
  9. 1 1
      dist/preview release/gui/babylon.gui.min.js
  10. 263 263
      dist/preview release/inspector/babylon.inspector.bundle.js
  11. 3 3
      dist/preview release/inspector/babylon.inspector.min.js
  12. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  13. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  14. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  15. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  16. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  17. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  18. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  19. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  20. 2 2
      src/Materials/Textures/babylon.baseTexture.ts
  21. 3 4
      src/babylon.engine.ts
  22. 0 1
      src/babylon.mixins.ts
  23. BIN
      tests/validation/ReferenceImages/pbrglossy.png
  24. 6 0
      tests/validation/config.json

File diff suppressed because it is too large
+ 1712 - 1713
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 31 - 31
dist/preview release/babylon.js


+ 5 - 6
dist/preview release/babylon.max.js

@@ -9118,7 +9118,7 @@ var BABYLON;
             }
             scene._addPendingData(texture);
             texture.url = url;
-            texture.noMipmap = noMipmap;
+            texture.generateMipMaps = !noMipmap;
             texture.references = 1;
             texture.samplingMode = samplingMode;
             texture.onLoadedCallbacks = [];
@@ -9749,7 +9749,7 @@ var BABYLON;
             texture.url = rootUrl;
             texture.references = 1;
             texture.onLoadedCallbacks = [];
-            texture.noMipmap = noMipmap;
+            texture.generateMipMaps = !noMipmap;
             var isKTX = false;
             var isDDS = false;
             var lastDot = rootUrl.lastIndexOf('.');
@@ -9897,7 +9897,7 @@ var BABYLON;
             var texture = gl.createTexture();
             texture.isCube = true;
             texture.references = 1;
-            texture.noMipmap = !generateMipMaps;
+            texture.generateMipMaps = generateMipMaps;
             texture.format = format;
             texture.type = type;
             var textureType = this._getWebGLTextureType(type);
@@ -9917,7 +9917,6 @@ var BABYLON;
             if (!isPot) {
                 generateMipMaps = false;
             }
-            texture.generateMipMaps = generateMipMaps;
             // Upload data if needed. The texture won t be ready until then.
             if (data) {
                 this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
@@ -19156,7 +19155,7 @@ var BABYLON;
             var texturesCache = this._scene.getEngine().getLoadedTexturesCache();
             for (var index = 0; index < texturesCache.length; index++) {
                 var texturesCacheEntry = texturesCache[index];
-                if (texturesCacheEntry.url === url && texturesCacheEntry.noMipmap === noMipmap) {
+                if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
                     texturesCache.splice(index, 1);
                     return;
                 }
@@ -19166,7 +19165,7 @@ var BABYLON;
             var texturesCache = this._scene.getEngine().getLoadedTexturesCache();
             for (var index = 0; index < texturesCache.length; index++) {
                 var texturesCacheEntry = texturesCache[index];
-                if (texturesCacheEntry.url === url && texturesCacheEntry.noMipmap === noMipmap) {
+                if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
                     if (!sampling || sampling === texturesCacheEntry.samplingMode) {
                         texturesCacheEntry.references++;
                         return texturesCacheEntry;

File diff suppressed because it is too large
+ 1712 - 1713
dist/preview release/babylon.module.d.ts


File diff suppressed because it is too large
+ 32 - 32
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 3287 - 3287
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


File diff suppressed because it is too large
+ 20 - 20
dist/preview release/customConfigurations/minimalViewer/babylon.js


File diff suppressed because it is too large
+ 3287 - 3287
dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


File diff suppressed because it is too large
+ 263 - 263
dist/preview release/inspector/babylon.inspector.bundle.js


File diff suppressed because it is too large
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js


File diff suppressed because it is too large
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


File diff suppressed because it is too large
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


+ 2 - 2
src/Materials/Textures/babylon.baseTexture.ts

@@ -183,7 +183,7 @@
             for (var index = 0; index < texturesCache.length; index++) {
                 var texturesCacheEntry = texturesCache[index];
 
-                if (texturesCacheEntry.url === url && texturesCacheEntry.noMipmap === noMipmap) {
+                if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
                     texturesCache.splice(index, 1);
                     return;
                 }
@@ -195,7 +195,7 @@
             for (var index = 0; index < texturesCache.length; index++) {
                 var texturesCacheEntry = texturesCache[index];
 
-                if (texturesCacheEntry.url === url && texturesCacheEntry.noMipmap === noMipmap) {
+                if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
                     if (!sampling || sampling === texturesCacheEntry.samplingMode) {
                         texturesCacheEntry.references++;
                         return texturesCacheEntry;

+ 3 - 4
src/babylon.engine.ts

@@ -2433,7 +2433,7 @@
 
             scene._addPendingData(texture);
             texture.url = url;
-            texture.noMipmap = noMipmap;
+            texture.generateMipMaps = !noMipmap;
             texture.references = 1;
             texture.samplingMode = samplingMode;
             texture.onLoadedCallbacks = [];
@@ -3216,7 +3216,7 @@
             texture.url = rootUrl;
             texture.references = 1;
             texture.onLoadedCallbacks = [];
-            texture.noMipmap = noMipmap;
+            texture.generateMipMaps = !noMipmap;
 
             var isKTX = false;
             var isDDS = false;
@@ -3398,7 +3398,7 @@
             var texture = gl.createTexture();
             texture.isCube = true;
             texture.references = 1;
-            texture.noMipmap = !generateMipMaps;
+            texture.generateMipMaps = generateMipMaps;
             texture.format = format;
             texture.type = type;
 
@@ -3423,7 +3423,6 @@
             if (!isPot) {
                 generateMipMaps = false;
             }
-            texture.generateMipMaps = generateMipMaps;
 
             // Upload data if needed. The texture won t be ready until then.
             if (data) {

+ 0 - 1
src/babylon.mixins.ts

@@ -103,7 +103,6 @@ interface WebGLTexture {
     isReady: boolean;
     isCube: boolean;
     url: string;
-    noMipmap: boolean;
     samplingMode: number;
     references: number;
     generateMipMaps: boolean;

BIN
tests/validation/ReferenceImages/pbrglossy.png


+ 6 - 0
tests/validation/config.json

@@ -173,6 +173,12 @@
       "replace": "/Scenes/Customs/skybox/, https://cdn.rawgit.com/BabylonJS/Website/06ecbea7/Assets/skybox/"
     },
     {
+      "title": "PBR glossy",
+      "scriptToRun": "/Demos/PBRGlossy/index.js",
+      "functionToCall": "CreatePBRGlossyScene",
+      "referenceImage": "pbrglossy.png"
+    },
+    {
       "title": "Water material (only visual check)",
       "renderCount": 10,
       "scriptToRun": "/Demos/WaterMaterial/water.js",