|
@@ -7282,7 +7282,8 @@ var BABYLON;
|
|
// Constants
|
|
// Constants
|
|
this._gl.HALF_FLOAT_OES = 0x8D61; // Half floating-point type (16-bit).
|
|
this._gl.HALF_FLOAT_OES = 0x8D61; // Half floating-point type (16-bit).
|
|
this._gl.RGBA16F = 0x881A; // RGBA 16-bit floating-point color-renderable internal sized format.
|
|
this._gl.RGBA16F = 0x881A; // RGBA 16-bit floating-point color-renderable internal sized format.
|
|
- this._gl.RGBA32F = 0x8814; // RGBA 32-bit floating-point color-renderable internal sized format.
|
|
|
|
|
|
+ this._gl.RGBA32F = 0x8814; // RGBA 32-bit floating-point color-renderable internal sized format.
|
|
|
|
+ this._gl.DEPTH24_STENCIL8 = 35056;
|
|
// Extensions
|
|
// Extensions
|
|
this._caps.standardDerivatives = this._webGLVersion > 1 || (this._gl.getExtension('OES_standard_derivatives') !== null);
|
|
this._caps.standardDerivatives = this._webGLVersion > 1 || (this._gl.getExtension('OES_standard_derivatives') !== null);
|
|
this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc');
|
|
this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc');
|
|
@@ -8196,6 +8197,9 @@ var BABYLON;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
Engine.prototype.bindFramebuffer = function (texture, faceIndex, requiredWidth, requiredHeight) {
|
|
Engine.prototype.bindFramebuffer = function (texture, faceIndex, requiredWidth, requiredHeight) {
|
|
|
|
+ if (this._currentRenderTarget) {
|
|
|
|
+ this.unBindFramebuffer(this._currentRenderTarget);
|
|
|
|
+ }
|
|
this._currentRenderTarget = texture;
|
|
this._currentRenderTarget = texture;
|
|
this.bindUnboundFramebuffer(texture._MSAAFramebuffer ? texture._MSAAFramebuffer : texture._framebuffer);
|
|
this.bindUnboundFramebuffer(texture._MSAAFramebuffer ? texture._MSAAFramebuffer : texture._framebuffer);
|
|
var gl = this._gl;
|
|
var gl = this._gl;
|
|
@@ -8247,8 +8251,12 @@ var BABYLON;
|
|
this._gl.flush();
|
|
this._gl.flush();
|
|
};
|
|
};
|
|
Engine.prototype.restoreDefaultFramebuffer = function () {
|
|
Engine.prototype.restoreDefaultFramebuffer = function () {
|
|
- this._currentRenderTarget = null;
|
|
|
|
- this.bindUnboundFramebuffer(null);
|
|
|
|
|
|
+ if (this._currentRenderTarget) {
|
|
|
|
+ this.unBindFramebuffer(this._currentRenderTarget);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ this.bindUnboundFramebuffer(null);
|
|
|
|
+ }
|
|
if (this._cachedViewport) {
|
|
if (this._cachedViewport) {
|
|
this.setViewport(this._cachedViewport);
|
|
this.setViewport(this._cachedViewport);
|
|
}
|
|
}
|
|
@@ -9523,7 +9531,7 @@ var BABYLON;
|
|
depthStencilBuffer = gl.createRenderbuffer();
|
|
depthStencilBuffer = gl.createRenderbuffer();
|
|
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
|
|
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
|
|
if (samples > 1) {
|
|
if (samples > 1) {
|
|
- gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.DEPTH_STENCIL, width, height);
|
|
|
|
|
|
+ gl.renderbufferStorageMultisample(gl.RENDERBUFFER, samples, gl.DEPTH24_STENCIL8, width, height);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
|
|
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
|