瀏覽代碼

Extract more occlusionquery code

David Catuhe 7 年之前
父節點
當前提交
d7faa73d11

文件差異過大導致無法顯示
+ 4998 - 4994
Playground/babylon.d.txt


文件差異過大導致無法顯示
+ 4995 - 4991
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 45 - 45
dist/preview release/babylon.js


+ 56 - 41
dist/preview release/babylon.max.js

@@ -19400,8 +19400,11 @@ var BABYLON;
             * @see http://doc.babylonjs.com/features/occlusionquery
             */
             _this.occlusionRetryCount = -1;
+            /** @hidden */
             _this._occlusionInternalRetryCounter = 0;
+            /** @hidden */
             _this._isOccluded = false;
+            /** @hidden */
             _this._isOcclusionQueryInProgress = false;
             _this._visibility = 1.0;
             /** Gets or sets the alpha index used to sort transparent meshes
@@ -21269,45 +21272,7 @@ var BABYLON;
         };
         /** @hidden */
         AbstractMesh.prototype._checkOcclusionQuery = function () {
-            var engine = this.getEngine();
-            if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
-                this._isOccluded = false;
-                return;
-            }
-            if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
-                var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
-                if (isOcclusionQueryAvailable) {
-                    var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
-                    this._isOcclusionQueryInProgress = false;
-                    this._occlusionInternalRetryCounter = 0;
-                    this._isOccluded = occlusionQueryResult === 1 ? false : true;
-                }
-                else {
-                    this._occlusionInternalRetryCounter++;
-                    if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
-                        this._isOcclusionQueryInProgress = false;
-                        this._occlusionInternalRetryCounter = 0;
-                        // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
-                        // if strict continue the last state of the object.
-                        this._isOccluded = this.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
-                    }
-                    else {
-                        return;
-                    }
-                }
-            }
-            // Todo. Move into an occlusion query component.
-            var scene = this.getScene();
-            if (scene.getBoundingBoxRenderer) {
-                var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
-                if (!this._occlusionQuery) {
-                    this._occlusionQuery = engine.createQuery();
-                }
-                engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
-                occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-                engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
-                this._isOcclusionQueryInProgress = true;
-            }
+            this._isOccluded = false;
         };
         /** No occlusion */
         AbstractMesh.OCCLUSION_TYPE_NONE = 0;
@@ -41104,8 +41069,13 @@ var BABYLON;
                     if (mesh && mesh.receiveShadows && scene.shadowsEnabled && light.shadowEnabled) {
                         var shadowGenerator = light.getShadowGenerator();
                         if (shadowGenerator) {
-                            shadowEnabled = true;
-                            shadowGenerator.prepareDefines(defines, lightIndex);
+                            var shadowMap = shadowGenerator.getShadowMapForRendering();
+                            if (shadowMap) {
+                                if (shadowMap.renderList && shadowMap.renderList.length > 0) {
+                                    shadowEnabled = true;
+                                    shadowGenerator.prepareDefines(defines, lightIndex);
+                                }
+                            }
                         }
                     }
                     if (light.lightmapMode != BABYLON.Light.LIGHTMAP_DEFAULT) {
@@ -104552,6 +104522,51 @@ var BABYLON;
     BABYLON.Engine.prototype._getGlAlgorithmType = function (algorithmType) {
         return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     };
+    // We also need to update AbstractMesh as there is a portion of the code there
+    BABYLON.AbstractMesh.prototype._checkOcclusionQuery = function () {
+        var engine = this.getEngine();
+        if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
+            this._isOccluded = false;
+            return;
+        }
+        if (engine.webGLVersion < 2 || this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
+            this._isOccluded = false;
+            return;
+        }
+        if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
+            var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
+            if (isOcclusionQueryAvailable) {
+                var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
+                this._isOcclusionQueryInProgress = false;
+                this._occlusionInternalRetryCounter = 0;
+                this._isOccluded = occlusionQueryResult === 1 ? false : true;
+            }
+            else {
+                this._occlusionInternalRetryCounter++;
+                if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                    this._isOcclusionQueryInProgress = false;
+                    this._occlusionInternalRetryCounter = 0;
+                    // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
+                    // if strict continue the last state of the object.
+                    this._isOccluded = this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
+                }
+                else {
+                    return;
+                }
+            }
+        }
+        var scene = this.getScene();
+        if (scene.getBoundingBoxRenderer) {
+            var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
+            if (!this._occlusionQuery) {
+                this._occlusionQuery = engine.createQuery();
+            }
+            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
+            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            this._isOcclusionQueryInProgress = true;
+        }
+    };
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.engine.occlusionQuery.js.map

+ 56 - 41
dist/preview release/babylon.no-module.max.js

@@ -19367,8 +19367,11 @@ var BABYLON;
             * @see http://doc.babylonjs.com/features/occlusionquery
             */
             _this.occlusionRetryCount = -1;
+            /** @hidden */
             _this._occlusionInternalRetryCounter = 0;
+            /** @hidden */
             _this._isOccluded = false;
+            /** @hidden */
             _this._isOcclusionQueryInProgress = false;
             _this._visibility = 1.0;
             /** Gets or sets the alpha index used to sort transparent meshes
@@ -21236,45 +21239,7 @@ var BABYLON;
         };
         /** @hidden */
         AbstractMesh.prototype._checkOcclusionQuery = function () {
-            var engine = this.getEngine();
-            if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
-                this._isOccluded = false;
-                return;
-            }
-            if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
-                var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
-                if (isOcclusionQueryAvailable) {
-                    var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
-                    this._isOcclusionQueryInProgress = false;
-                    this._occlusionInternalRetryCounter = 0;
-                    this._isOccluded = occlusionQueryResult === 1 ? false : true;
-                }
-                else {
-                    this._occlusionInternalRetryCounter++;
-                    if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
-                        this._isOcclusionQueryInProgress = false;
-                        this._occlusionInternalRetryCounter = 0;
-                        // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
-                        // if strict continue the last state of the object.
-                        this._isOccluded = this.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
-                    }
-                    else {
-                        return;
-                    }
-                }
-            }
-            // Todo. Move into an occlusion query component.
-            var scene = this.getScene();
-            if (scene.getBoundingBoxRenderer) {
-                var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
-                if (!this._occlusionQuery) {
-                    this._occlusionQuery = engine.createQuery();
-                }
-                engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
-                occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-                engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
-                this._isOcclusionQueryInProgress = true;
-            }
+            this._isOccluded = false;
         };
         /** No occlusion */
         AbstractMesh.OCCLUSION_TYPE_NONE = 0;
@@ -41071,8 +41036,13 @@ var BABYLON;
                     if (mesh && mesh.receiveShadows && scene.shadowsEnabled && light.shadowEnabled) {
                         var shadowGenerator = light.getShadowGenerator();
                         if (shadowGenerator) {
-                            shadowEnabled = true;
-                            shadowGenerator.prepareDefines(defines, lightIndex);
+                            var shadowMap = shadowGenerator.getShadowMapForRendering();
+                            if (shadowMap) {
+                                if (shadowMap.renderList && shadowMap.renderList.length > 0) {
+                                    shadowEnabled = true;
+                                    shadowGenerator.prepareDefines(defines, lightIndex);
+                                }
+                            }
                         }
                     }
                     if (light.lightmapMode != BABYLON.Light.LIGHTMAP_DEFAULT) {
@@ -104519,6 +104489,51 @@ var BABYLON;
     BABYLON.Engine.prototype._getGlAlgorithmType = function (algorithmType) {
         return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     };
+    // We also need to update AbstractMesh as there is a portion of the code there
+    BABYLON.AbstractMesh.prototype._checkOcclusionQuery = function () {
+        var engine = this.getEngine();
+        if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
+            this._isOccluded = false;
+            return;
+        }
+        if (engine.webGLVersion < 2 || this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
+            this._isOccluded = false;
+            return;
+        }
+        if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
+            var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
+            if (isOcclusionQueryAvailable) {
+                var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
+                this._isOcclusionQueryInProgress = false;
+                this._occlusionInternalRetryCounter = 0;
+                this._isOccluded = occlusionQueryResult === 1 ? false : true;
+            }
+            else {
+                this._occlusionInternalRetryCounter++;
+                if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                    this._isOcclusionQueryInProgress = false;
+                    this._occlusionInternalRetryCounter = 0;
+                    // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
+                    // if strict continue the last state of the object.
+                    this._isOccluded = this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
+                }
+                else {
+                    return;
+                }
+            }
+        }
+        var scene = this.getScene();
+        if (scene.getBoundingBoxRenderer) {
+            var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
+            if (!this._occlusionQuery) {
+                this._occlusionQuery = engine.createQuery();
+            }
+            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
+            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            this._isOcclusionQueryInProgress = true;
+        }
+    };
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.engine.occlusionQuery.js.map

文件差異過大導致無法顯示
+ 45 - 45
dist/preview release/babylon.worker.js


+ 56 - 41
dist/preview release/es6.js

@@ -19367,8 +19367,11 @@ var BABYLON;
             * @see http://doc.babylonjs.com/features/occlusionquery
             */
             _this.occlusionRetryCount = -1;
+            /** @hidden */
             _this._occlusionInternalRetryCounter = 0;
+            /** @hidden */
             _this._isOccluded = false;
+            /** @hidden */
             _this._isOcclusionQueryInProgress = false;
             _this._visibility = 1.0;
             /** Gets or sets the alpha index used to sort transparent meshes
@@ -21236,45 +21239,7 @@ var BABYLON;
         };
         /** @hidden */
         AbstractMesh.prototype._checkOcclusionQuery = function () {
-            var engine = this.getEngine();
-            if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
-                this._isOccluded = false;
-                return;
-            }
-            if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
-                var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
-                if (isOcclusionQueryAvailable) {
-                    var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
-                    this._isOcclusionQueryInProgress = false;
-                    this._occlusionInternalRetryCounter = 0;
-                    this._isOccluded = occlusionQueryResult === 1 ? false : true;
-                }
-                else {
-                    this._occlusionInternalRetryCounter++;
-                    if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
-                        this._isOcclusionQueryInProgress = false;
-                        this._occlusionInternalRetryCounter = 0;
-                        // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
-                        // if strict continue the last state of the object.
-                        this._isOccluded = this.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
-                    }
-                    else {
-                        return;
-                    }
-                }
-            }
-            // Todo. Move into an occlusion query component.
-            var scene = this.getScene();
-            if (scene.getBoundingBoxRenderer) {
-                var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
-                if (!this._occlusionQuery) {
-                    this._occlusionQuery = engine.createQuery();
-                }
-                engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
-                occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-                engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
-                this._isOcclusionQueryInProgress = true;
-            }
+            this._isOccluded = false;
         };
         /** No occlusion */
         AbstractMesh.OCCLUSION_TYPE_NONE = 0;
@@ -41071,8 +41036,13 @@ var BABYLON;
                     if (mesh && mesh.receiveShadows && scene.shadowsEnabled && light.shadowEnabled) {
                         var shadowGenerator = light.getShadowGenerator();
                         if (shadowGenerator) {
-                            shadowEnabled = true;
-                            shadowGenerator.prepareDefines(defines, lightIndex);
+                            var shadowMap = shadowGenerator.getShadowMapForRendering();
+                            if (shadowMap) {
+                                if (shadowMap.renderList && shadowMap.renderList.length > 0) {
+                                    shadowEnabled = true;
+                                    shadowGenerator.prepareDefines(defines, lightIndex);
+                                }
+                            }
                         }
                     }
                     if (light.lightmapMode != BABYLON.Light.LIGHTMAP_DEFAULT) {
@@ -104519,6 +104489,51 @@ var BABYLON;
     BABYLON.Engine.prototype._getGlAlgorithmType = function (algorithmType) {
         return algorithmType === BABYLON.AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     };
+    // We also need to update AbstractMesh as there is a portion of the code there
+    BABYLON.AbstractMesh.prototype._checkOcclusionQuery = function () {
+        var engine = this.getEngine();
+        if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
+            this._isOccluded = false;
+            return;
+        }
+        if (engine.webGLVersion < 2 || this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_NONE) {
+            this._isOccluded = false;
+            return;
+        }
+        if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
+            var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
+            if (isOcclusionQueryAvailable) {
+                var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
+                this._isOcclusionQueryInProgress = false;
+                this._occlusionInternalRetryCounter = 0;
+                this._isOccluded = occlusionQueryResult === 1 ? false : true;
+            }
+            else {
+                this._occlusionInternalRetryCounter++;
+                if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                    this._isOcclusionQueryInProgress = false;
+                    this._occlusionInternalRetryCounter = 0;
+                    // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
+                    // if strict continue the last state of the object.
+                    this._isOccluded = this.occlusionType === BABYLON.AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
+                }
+                else {
+                    return;
+                }
+            }
+        }
+        var scene = this.getScene();
+        if (scene.getBoundingBoxRenderer) {
+            var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
+            if (!this._occlusionQuery) {
+                this._occlusionQuery = engine.createQuery();
+            }
+            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
+            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            this._isOcclusionQueryInProgress = true;
+        }
+    };
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.engine.occlusionQuery.js.map

文件差異過大導致無法顯示
+ 48 - 48
dist/preview release/viewer/babylon.viewer.js


文件差異過大導致無法顯示
+ 64 - 48
dist/preview release/viewer/babylon.viewer.max.js


+ 58 - 0
src/Engine/Extensions/babylon.engine.occlusionQuery.ts

@@ -247,4 +247,62 @@ module BABYLON {
     Engine.prototype._getGlAlgorithmType = function(algorithmType: number): number {
         return algorithmType === AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;
     }
+
+    // We also need to update AbstractMesh as there is a portion of the code there
+    AbstractMesh.prototype._checkOcclusionQuery = function() {
+        var engine = this.getEngine();
+
+        if (!engine.isQueryResultAvailable) { // Occlusion query where not referenced
+            this._isOccluded = false;
+            return;
+        }
+
+        if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
+            this._isOccluded = false;
+            return;
+        }
+
+        if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
+
+            var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
+            if (isOcclusionQueryAvailable) {
+                var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
+
+                this._isOcclusionQueryInProgress = false;
+                this._occlusionInternalRetryCounter = 0;
+                this._isOccluded = occlusionQueryResult === 1 ? false : true;
+            }
+            else {
+
+                this._occlusionInternalRetryCounter++;
+
+                if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
+                    this._isOcclusionQueryInProgress = false;
+                    this._occlusionInternalRetryCounter = 0;
+
+                    // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
+                    // if strict continue the last state of the object.
+                    this._isOccluded = this.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
+                }
+                else {
+                    return;
+                }
+
+            }
+        }
+
+        var scene = this.getScene();
+        if (scene.getBoundingBoxRenderer) {
+        var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
+
+            if (!this._occlusionQuery) {
+                this._occlusionQuery = engine.createQuery();
+            }
+
+            engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
+            occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
+            engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
+            this._isOcclusionQueryInProgress = true;
+        }
+    } 
 }

+ 10 - 55
src/Mesh/babylon.abstractMesh.ts

@@ -205,9 +205,11 @@
         * @see http://doc.babylonjs.com/features/occlusionquery
         */
         public occlusionRetryCount = -1;
-        private _occlusionInternalRetryCounter = 0;
+        /** @hidden */
+        public _occlusionInternalRetryCounter = 0;
 
-        protected _isOccluded = false;
+        /** @hidden */
+        public _isOccluded = false;
 
         /**
         * Gets or sets whether the mesh is occluded or not, it is used also to set the intial state of the mesh to be occluded or not
@@ -221,7 +223,8 @@
             this._isOccluded = value;
         }
 
-        private _isOcclusionQueryInProgress = false;
+        /** @hidden */
+        public _isOcclusionQueryInProgress = false;
 
         /**
          * Flag to check the progress status of the query
@@ -231,7 +234,8 @@
             return this._isOcclusionQueryInProgress;
         }
 
-        private _occlusionQuery: Nullable<WebGLQuery>;
+        /** @hidden */
+        public _occlusionQuery: Nullable<WebGLQuery>;
 
         private _visibility = 1.0;
 
@@ -2104,57 +2108,8 @@
         }
 
         /** @hidden */
-        protected _checkOcclusionQuery() {
-            var engine = this.getEngine();
-
-            if (engine.webGLVersion < 2 || this.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
-                this._isOccluded = false;
-                return;
-            }
-
-            if (this.isOcclusionQueryInProgress && this._occlusionQuery) {
-
-                var isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
-                if (isOcclusionQueryAvailable) {
-                    var occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
-
-                    this._isOcclusionQueryInProgress = false;
-                    this._occlusionInternalRetryCounter = 0;
-                    this._isOccluded = occlusionQueryResult === 1 ? false : true;
-                }
-                else {
-
-                    this._occlusionInternalRetryCounter++;
-
-                    if (this.occlusionRetryCount !== -1 && this._occlusionInternalRetryCounter > this.occlusionRetryCount) {
-                        this._isOcclusionQueryInProgress = false;
-                        this._occlusionInternalRetryCounter = 0;
-
-                        // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
-                        // if strict continue the last state of the object.
-                        this._isOccluded = this.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : this._isOccluded;
-                    }
-                    else {
-                        return;
-                    }
-
-                }
-            }
-
-            // Todo. Move into an occlusion query component.
-            var scene = this.getScene();
-            if (scene.getBoundingBoxRenderer) {
-               var occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
-
-                if (!this._occlusionQuery) {
-                    this._occlusionQuery = engine.createQuery();
-                }
-
-                engine.beginOcclusionQuery(this.occlusionQueryAlgorithmType, this._occlusionQuery);
-                occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
-                engine.endOcclusionQuery(this.occlusionQueryAlgorithmType);
-                this._isOcclusionQueryInProgress = true;
-            }
+        public _checkOcclusionQuery() { // Will be replaced by correct code if Occlusion queries are referenced
+            this._isOccluded = false;
         }
     }
 }