|
@@ -5570,15 +5570,19 @@ var BABYLON;
|
|
};
|
|
};
|
|
Engine.prototype.clear = function (color, backBuffer, depthStencil) {
|
|
Engine.prototype.clear = function (color, backBuffer, depthStencil) {
|
|
this.applyStates();
|
|
this.applyStates();
|
|
- this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
|
|
|
|
- if (this._depthCullingState.depthMask) {
|
|
|
|
|
|
+ if (backBuffer) {
|
|
|
|
+ this._gl.clearColor(color.r, color.g, color.b, color.a !== undefined ? color.a : 1.0);
|
|
|
|
+ }
|
|
|
|
+ if (depthStencil && this._depthCullingState.depthMask) {
|
|
this._gl.clearDepth(1.0);
|
|
this._gl.clearDepth(1.0);
|
|
}
|
|
}
|
|
var mode = 0;
|
|
var mode = 0;
|
|
- if (backBuffer)
|
|
|
|
|
|
+ if (backBuffer) {
|
|
mode |= this._gl.COLOR_BUFFER_BIT;
|
|
mode |= this._gl.COLOR_BUFFER_BIT;
|
|
- if (depthStencil && this._depthCullingState.depthMask)
|
|
|
|
|
|
+ }
|
|
|
|
+ if (depthStencil && this._depthCullingState.depthMask) {
|
|
mode |= this._gl.DEPTH_BUFFER_BIT;
|
|
mode |= this._gl.DEPTH_BUFFER_BIT;
|
|
|
|
+ }
|
|
this._gl.clear(mode);
|
|
this._gl.clear(mode);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -11862,7 +11866,7 @@ var BABYLON;
|
|
this._currentRenderParticles = renderParticles;
|
|
this._currentRenderParticles = renderParticles;
|
|
this._currentRenderSprites = renderSprites;
|
|
this._currentRenderSprites = renderSprites;
|
|
for (var index = 0; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
|
|
for (var index = 0; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
|
|
- this._depthBufferAlreadyCleaned = false;
|
|
|
|
|
|
+ this._depthBufferAlreadyCleaned = index == 0;
|
|
var renderingGroup = this._renderingGroups[index];
|
|
var renderingGroup = this._renderingGroups[index];
|
|
var needToStepBack = false;
|
|
var needToStepBack = false;
|
|
this._currentIndex = index;
|
|
this._currentIndex = index;
|