Bladeren bron

Refactoring occlusion query

DESKTOP-QJU4N0L\mityh 8 jaren geleden
bovenliggende
commit
864c54ef78

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


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


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

@@ -10993,13 +10993,16 @@ var BABYLON;
             return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT);
         };
         Engine.prototype.beginQuery = function (algorithmType, query) {
-            var glAlgorithm = algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+            var glAlgorithm = this.getGlAlgorithmType(algorithmType);
             this._gl.beginQuery(glAlgorithm, query);
         };
         Engine.prototype.endQuery = function (algorithmType) {
-            var glAlgorithm = algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+            var glAlgorithm = this.getGlAlgorithmType(algorithmType);
             this._gl.endQuery(glAlgorithm);
         };
+        Engine.prototype.getGlAlgorithmType = function (algorithmType) {
+            return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+        };
         // Statics
         Engine.isSupported = function () {
             try {

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


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


File diff suppressed because it is too large
+ 2822 - 2821
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


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


+ 5 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -10993,13 +10993,16 @@ var BABYLON;
             return this._gl.getQueryParameter(query, this._gl.QUERY_RESULT);
         };
         Engine.prototype.beginQuery = function (algorithmType, query) {
-            var glAlgorithm = algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+            var glAlgorithm = this.getGlAlgorithmType(algorithmType);
             this._gl.beginQuery(glAlgorithm, query);
         };
         Engine.prototype.endQuery = function (algorithmType) {
-            var glAlgorithm = algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+            var glAlgorithm = this.getGlAlgorithmType(algorithmType);
             this._gl.endQuery(glAlgorithm);
         };
+        Engine.prototype.getGlAlgorithmType = function (algorithmType) {
+            return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+        };
         // Statics
         Engine.isSupported = function () {
             try {

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


+ 6 - 2
src/babylon.engine.ts

@@ -4404,15 +4404,19 @@
         }
 
         public beginQuery(algorithmType: number, query: WebGLQuery) {
-            var glAlgorithm = algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+            var glAlgorithm = this.getGlAlgorithmType(algorithmType);
             this._gl.beginQuery(glAlgorithm, query);
         }
 
         public endQuery(algorithmType: number) {
-            var glAlgorithm = algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+            var glAlgorithm = this.getGlAlgorithmType(algorithmType);
             this._gl.endQuery(glAlgorithm);
         }
 
+        private getGlAlgorithmType(algorithmType: number): number {
+            return algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
+        }
+
         // Statics
         public static isSupported(): boolean {
             try {