|
@@ -3417,6 +3417,8 @@ var BABYLON;
|
|
|
};
|
|
|
|
|
|
Engine.prototype.clear = function (color, backBuffer, depthStencil) {
|
|
|
+ this.applyStates();
|
|
|
+
|
|
|
this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
|
|
|
if (this._depthCullingState.depthMask) {
|
|
|
this._gl.clearDepth(1.0);
|
|
@@ -3650,10 +3652,14 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- Engine.prototype.draw = function (useTriangles, indexStart, indexCount, instancesCount) {
|
|
|
-
|
|
|
+ Engine.prototype.applyStates = function () {
|
|
|
this._depthCullingState.apply(this._gl);
|
|
|
this._alphaState.apply(this._gl);
|
|
|
+ };
|
|
|
+
|
|
|
+ Engine.prototype.draw = function (useTriangles, indexStart, indexCount, instancesCount) {
|
|
|
+
|
|
|
+ this.applyStates();
|
|
|
|
|
|
|
|
|
if (instancesCount) {
|