{"record":{"id":"3e464b966b524688","repo":"phaserjs/phaser","slug":"oes-standard-derivatives-extension-not-supported","errorCode":null,"errorMessage":"OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.","messagePattern":"OES_standard_derivatives extension not supported\\. Cannot use smoothPixelArt\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/renderer/webgl/WebGLRenderer.js","lineNumber":932,"sourceCode":"            {\n                gl.createVertexArray = this.vaoExtension.createVertexArrayOES.bind(this.vaoExtension);\n                gl.bindVertexArray = this.vaoExtension.bindVertexArrayOES.bind(this.vaoExtension);\n                gl.deleteVertexArray = this.vaoExtension.deleteVertexArrayOES.bind(this.vaoExtension);\n                gl.isVertexArray = this.vaoExtension.isVertexArrayOES.bind(this.vaoExtension);\n            }\n            else\n            {\n                throw new Error('OES_vertex_array_object extension not supported. Required for rendering.');\n            }\n\n            // Incorporate standard derivatives.\n            if (this.standardDerivativesExtension)\n            {\n                gl.FRAGMENT_SHADER_DERIVATIVE_HINT = this.standardDerivativesExtension.FRAGMENT_SHADER_DERIVATIVE_HINT_OES;\n            }\n            else if (game.config.smoothPixelArt)\n            {\n                throw new Error('OES_standard_derivatives extension not supported. Cannot use smoothPixelArt.');\n            }\n        }\n    },\n\n    /**\n     * Sets the handlers that are called when WebGL context is lost or restored by the browser.\n     *\n     * The default handlers are referenced via the properties `WebGLRenderer.contextLostHandler` and `WebGLRenderer.contextRestoredHandler`.\n     * By default, these map to the methods `WebGLRenderer.dispatchContextLost` and `WebGLRenderer.dispatchContextRestored`.\n     *\n     * You can override these handlers with your own via this method.\n     *\n     * If you do override them, make sure that your handlers invoke the methods `WebGLRenderer.dispatchContextLost` and `WebGLRenderer.dispatchContextRestored` in due course, otherwise the renderer will not be able to restore itself fully.\n     *\n     * @method Phaser.Renderer.WebGL.WebGLRenderer#setContextHandlers\n     * @since 3.85.0\n     *\n     * @param {function} [contextLost] - Custom handler for responding to the WebGL context lost event. Set as `undefined` to use the default handler.","sourceCodeStart":914,"sourceCodeEnd":950,"githubUrl":"https://github.com/phaserjs/phaser/blob/41be1e462bc600064e498cba370bfa8c5c055a22/src/renderer/webgl/WebGLRenderer.js#L914-L950","documentation":"WebGLRenderer.js:932 throws only when `game.config.smoothPixelArt` is true AND `this.standardDerivativesExtension` (OES_standard_derivatives) is unavailable under WebGL1. Unlike errors 17/18 this extension is optional — Phaser only demands it when the user explicitly enabled the smooth-pixel-art shader feature, which needs derivative hints.","triggerScenarios":"Configuring `render: { smoothPixelArt: true }` (or top-level `smoothPixelArt: true`) on a WebGL1 context lacking OES_standard_derivatives. Config.js:409 reads this flag; WebGL2 has derivatives built-in so the branch is skipped.","commonSituations":"Enabling smoothPixelArt for crisp scaled pixel art, then deploying to an old WebGL1 device without the derivatives extension; testing on a minimal software GL backend.","solutions":["Disable `smoothPixelArt` in the config (use `pixelArt: true` / `antialias: false` instead for blocky pixel rendering).","Move to a WebGL2-capable device/browser where derivatives are core.","Keep smoothPixelArt only when you can guarantee WebGL2 or the OES extension."],"exampleFix":"// before\nnew Phaser.Game({ smoothPixelArt: true, type: Phaser.WEBGL })\n// after\nnew Phaser.Game({ pixelArt: true, type: Phaser.WEBGL })","handlingStrategy":"validation","validationCode":"let cfg = { type: Phaser.WEBGL, smoothPixelArt: true }\nif (cfg.smoothPixelArt) {\n  const c = document.createElement('canvas')\n  const gl2 = c.getContext('webgl2')\n  const gl1 = !gl2 && c.getContext('webgl')\n  const hasDerivatives = !!gl2 || !!(gl1 && gl1.getExtension('OES_standard_derivatives'))\n  if (!hasDerivatives) {\n    cfg = { ...cfg, smoothPixelArt: false, pixelArt: true }\n  }\n}\nconst game = new Phaser.Game(cfg)","typeGuard":"const webgl1HasDerivatives = () => {\n  const c = document.createElement('canvas')\n  if (c.getContext('webgl2')) return true\n  const gl = c.getContext('webgl')\n  return !!gl && !!gl.getExtension('OES_standard_derivatives')\n}","tryCatchPattern":"try {\n  game = new Phaser.Game({ type: Phaser.WEBGL, smoothPixelArt: true, ... })\n} catch (e) {\n  if (/OES_standard_derivatives/.test(e.message)) {\n    game = new Phaser.Game({ type: Phaser.WEBGL, pixelArt: true, ... })\n  } else { throw e }\n}","preventionTips":["Only enable smoothPixelArt on WebGL2-capable targets.","Probe for OES_standard_derivatives (or WebGL2) before setting smoothPixelArt.","Fall back to pixelArt:true when derivatives are unavailable."],"tags":["renderer","webgl","extensions","config","pixel-art"],"backgroundTag":null,"analyzedSha":"41be1e462bc600064e498cba370bfa8c5c055a22","analyzedAt":"2026-08-13T04:23:39.729Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}