|
@@ -1050,7 +1050,6 @@
|
|
this._caps.uintIndices = this._webGLVersion > 1 || this._gl.getExtension('OES_element_index_uint') !== null;
|
|
this._caps.uintIndices = this._webGLVersion > 1 || this._gl.getExtension('OES_element_index_uint') !== null;
|
|
this._caps.fragmentDepthSupported = this._webGLVersion > 1 || this._gl.getExtension('EXT_frag_depth') !== null;
|
|
this._caps.fragmentDepthSupported = this._webGLVersion > 1 || this._gl.getExtension('EXT_frag_depth') !== null;
|
|
this._caps.highPrecisionShaderSupported = true;
|
|
this._caps.highPrecisionShaderSupported = true;
|
|
- this._caps.drawBuffersExtension = this._webGLVersion > 1 || this._gl.getExtension('WEBGL_draw_buffers');
|
|
|
|
|
|
|
|
// Checks if some of the format renders first to allow the use of webgl inspector.
|
|
// Checks if some of the format renders first to allow the use of webgl inspector.
|
|
this._caps.colorBufferFloat = this._webGLVersion > 1 && this._gl.getExtension('EXT_color_buffer_float');
|
|
this._caps.colorBufferFloat = this._webGLVersion > 1 && this._gl.getExtension('EXT_color_buffer_float');
|
|
@@ -1068,6 +1067,25 @@
|
|
|
|
|
|
this._caps.textureLOD = this._webGLVersion > 1 || this._gl.getExtension('EXT_shader_texture_lod');
|
|
this._caps.textureLOD = this._webGLVersion > 1 || this._gl.getExtension('EXT_shader_texture_lod');
|
|
|
|
|
|
|
|
+ // Draw buffers
|
|
|
|
+ if (this._webGLVersion > 1) {
|
|
|
|
+ this._caps.drawBuffersExtension = true;
|
|
|
|
+ } else {
|
|
|
|
+ var drawBuffersExtension = this._gl.getExtension('WEBGL_draw_buffers');
|
|
|
|
+
|
|
|
|
+ if (drawBuffersExtension !== null) {
|
|
|
|
+ this._caps.drawBuffersExtension = true;
|
|
|
|
+ this._gl.drawBuffers = drawBuffersExtension.drawBuffersWEBGL;
|
|
|
|
+ this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;
|
|
|
|
+
|
|
|
|
+ for (var i = 0; i < 16; i++) {
|
|
|
|
+ this._gl["COLOR_ATTACHMENT" + i] = drawBuffersExtension["COLOR_ATTACHMENT" + i + "_WEBGL"];
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this._caps.drawBuffersExtension = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// Vertex array object
|
|
// Vertex array object
|
|
if (this._webGLVersion > 1) {
|
|
if (this._webGLVersion > 1) {
|
|
this._caps.vertexArrayObject = true;
|
|
this._caps.vertexArrayObject = true;
|
|
@@ -3190,7 +3208,7 @@
|
|
|
|
|
|
var width = size.width || size;
|
|
var width = size.width || size;
|
|
var height = size.height || size;
|
|
var height = size.height || size;
|
|
-
|
|
|
|
|
|
+
|
|
var textures = [];
|
|
var textures = [];
|
|
var attachments = []
|
|
var attachments = []
|
|
|
|
|
|
@@ -3217,6 +3235,7 @@
|
|
|
|
|
|
var texture = new InternalTexture(this, InternalTexture.DATASOURCE_MULTIRENDERTARGET);
|
|
var texture = new InternalTexture(this, InternalTexture.DATASOURCE_MULTIRENDERTARGET);
|
|
var attachment = gl["COLOR_ATTACHMENT" + i];
|
|
var attachment = gl["COLOR_ATTACHMENT" + i];
|
|
|
|
+
|
|
textures.push(texture);
|
|
textures.push(texture);
|
|
attachments.push(attachment);
|
|
attachments.push(attachment);
|
|
|
|
|
|
@@ -3269,7 +3288,7 @@
|
|
gl.texImage2D(
|
|
gl.texImage2D(
|
|
gl.TEXTURE_2D,
|
|
gl.TEXTURE_2D,
|
|
0,
|
|
0,
|
|
- gl.DEPTH_COMPONENT16,
|
|
|
|
|
|
+ this.webGLVersion < 2 ? gl.DEPTH_COMPONENT : gl.DEPTH_COMPONENT16,
|
|
width,
|
|
width,
|
|
height,
|
|
height,
|
|
0,
|
|
0,
|
|
@@ -4129,7 +4148,7 @@
|
|
|
|
|
|
if (internalTexture._cachedWrapU !== texture.wrapU) {
|
|
if (internalTexture._cachedWrapU !== texture.wrapU) {
|
|
internalTexture._cachedWrapU = texture.wrapU;
|
|
internalTexture._cachedWrapU = texture.wrapU;
|
|
-
|
|
|
|
|
|
+
|
|
switch (texture.wrapU) {
|
|
switch (texture.wrapU) {
|
|
case Texture.WRAP_ADDRESSMODE:
|
|
case Texture.WRAP_ADDRESSMODE:
|
|
this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.REPEAT);
|
|
this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.REPEAT);
|