Skip to content

Commit

Permalink
r163 drop WebGL1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ppillot committed Apr 10, 2024
1 parent d018310 commit b09d478
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 45 deletions.
3 changes: 0 additions & 3 deletions src/buffer/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/buffer/text-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 6 additions & 39 deletions src/viewer/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
Expand Down

0 comments on commit b09d478

Please sign in to comment.