diff --git a/src/buffer/buffer.ts b/src/buffer/buffer.ts index 4bf8d0b3..2b81d635 100755 --- a/src/buffer/buffer.ts +++ b/src/buffer/buffer.ts @@ -275,8 +275,6 @@ class Buffer { side: side }) m.vertexColors = true - m.extensions.derivatives = true - m.extensions.fragDepth = this.isImpostor const wm = new ShaderMaterial({ uniforms: this.uniforms, @@ -304,7 +302,6 @@ class Buffer { blending: NoBlending }) pm.vertexColors = true - pm.extensions.fragDepth = this.isImpostor ;(m as any).clipNear = this.parameters.clipNear ;(wm as any).clipNear = this.parameters.clipNear diff --git a/src/buffer/text-buffer.ts b/src/buffer/text-buffer.ts index d4f5dc02..501fccec 100644 --- a/src/buffer/text-buffer.ts +++ b/src/buffer/text-buffer.ts @@ -431,20 +431,17 @@ class TextBuffer extends MappedQuadBuffer { const m = this.material m.transparent = true - m.extensions.derivatives = true m.lights = false m.uniforms.fontTexture.value = tex m.needsUpdate = true const wm = this.wireframeMaterial wm.transparent = true - wm.extensions.derivatives = true wm.lights = false wm.uniforms.fontTexture.value = tex wm.needsUpdate = true const pm = this.pickingMaterial - pm.extensions.derivatives = true pm.lights = false pm.uniforms.fontTexture.value = tex pm.needsUpdate = true diff --git a/src/viewer/viewer.ts b/src/viewer/viewer.ts index 330f3eb7..6e66eb65 100644 --- a/src/viewer/viewer.ts +++ b/src/viewer/viewer.ts @@ -430,42 +430,12 @@ export default class Viewer { // console.log(gl.getContextAttributes().antialias) // console.log(gl.getParameter(gl.SAMPLES)) - // For WebGL1, extensions must be explicitly enabled. - // The following are builtin to WebGL2 (and don't appear as - // extensions) - // EXT_frag_depth, OES_element_index_uint, OES_texture_float - // OES_texture_half_float - - // The WEBGL_color_buffer_float extension is replaced by - // EXT_color_buffer_float - - // If not webgl2 context, explicitly check for these - if (!this.renderer.capabilities.isWebGL2) { - setExtensionFragDepth(this.renderer.extensions.get('EXT_frag_depth')) - this.renderer.extensions.get('OES_element_index_uint') - - setSupportsReadPixelsFloat( - (this.renderer.extensions.get('OES_texture_float') && - this.renderer.extensions.get('WEBGL_color_buffer_float')) || - (this.renderer.extensions.get('OES_texture_float') && - testTextureSupport(gl.FLOAT)) - ) - // picking texture - - this.renderer.extensions.get('OES_texture_float') - - this.supportsHalfFloat = ( - this.renderer.extensions.get('OES_texture_half_float') && - testTextureSupport(0x8D61) - ) - - } else { - setExtensionFragDepth(true) - setSupportsReadPixelsFloat( - this.renderer.extensions.get('EXT_color_buffer_float') - ) - this.supportsHalfFloat = true - } + // webgl2 context settings + setExtensionFragDepth(true) + setSupportsReadPixelsFloat( + this.renderer.extensions.get('EXT_color_buffer_float') + ) + this.supportsHalfFloat = true this.wrapper.appendChild(this.renderer.domElement) @@ -476,9 +446,6 @@ export default class Viewer { if (Debug) { console.log(JSON.stringify({ 'Browser': Browser, - 'OES_texture_float': !!this.renderer.extensions.get('OES_texture_float'), - 'OES_texture_half_float': !!this.renderer.extensions.get('OES_texture_half_float'), - 'WEBGL_color_buffer_float': !!this.renderer.extensions.get('WEBGL_color_buffer_float'), 'testTextureSupport Float': testTextureSupport(gl.FLOAT), 'testTextureSupport HalfFloat': testTextureSupport(0x8D61), 'this.supportsHalfFloat': this.supportsHalfFloat,