{"record":{"id":"40073c3414d40073","repo":"BabylonJS/Babylon.js","slug":"framegraphvolumetriclightingtask-name-the-cu","errorCode":null,"errorMessage":"FrameGraphVolumetricLightingTask \"${name}\": the current configuration is not supported. Use FrameGraphVolumetricLightingTask.IsSupported(engine, enableExtinction) to check before creating this task.","messagePattern":"FrameGraphVolumetricLightingTask \"(.+?)\": the current configuration is not supported\\. Use FrameGraphVolumetricLightingTask\\.IsSupported\\(engine, enableExtinction\\) to check before creating this task\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.ts","lineNumber":173,"sourceCode":"     */\r\n    public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n    private readonly _clearLightingVolumeTextureTask: FrameGraphClearTextureTask;\r\n    private readonly _renderLightingVolumeTask: FrameGraphObjectRendererTask;\r\n    private readonly _blendLightingVolumeTask: FrameGraphVolumetricLightingBlendVolumeTask;\r\n    private _renderLightingVolumeMaterial: ShaderMaterial;\r\n\r\n    /**\r\n     * Creates a new FrameGraphVolumetricLightingTask.\r\n     * @param name The name of the task.\r\n     * @param frameGraph The frame graph to which the task belongs.\r\n     * @param enableExtinction Whether to enable extinction in the volumetric lighting effect (default: false). If you don't plan to set extinction to something different than (0, 0, 0), you can disable this to save some performance.\r\n     */\r\n    constructor(name: string, frameGraph: FrameGraph, enableExtinction = false) {\r\n        super(name, frameGraph);\r\n\r\n        if (!FrameGraphVolumetricLightingTask.IsSupported(frameGraph.engine, enableExtinction)) {\r\n            throw new Error(\r\n                `FrameGraphVolumetricLightingTask \"${name}\": the current configuration is not supported. Use FrameGraphVolumetricLightingTask.IsSupported(engine, enableExtinction) to check before creating this task.`\r\n            );\r\n        }\r\n\r\n        this.enableExtinction = enableExtinction;\r\n\r\n        const isWebGPU = this._frameGraph.engine.isWebGPU;\r\n\r\n        this._renderLightingVolumeMaterial = new ShaderMaterial(`${name} - render lighting volume`, this._frameGraph.scene, \"volumetricLightingRenderVolume\", {\r\n            attributes: [\"position\"],\r\n            uniformBuffers: [\"Scene\", \"Mesh\"],\r\n            uniforms: [\"world\", \"viewProjection\", \"vEyePosition\", \"lightDir\", \"invViewProjection\", \"outputTextureSize\", \"extinctionPhaseG\", \"lightPower\", \"textureRatio\"],\r\n            samplers: [\"depthTexture\"],\r\n            defines: enableExtinction ? [\"USE_EXTINCTION\"] : [],\r\n            shaderLanguage: isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\r\n            needAlphaBlending: true,\r\n        });\r\n        this._renderLightingVolumeMaterial.backFaceCulling = false;\r","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.ts#L155-L191","documentation":"FrameGraphVolumetricLightingTask's constructor throws when the engine cannot run the volumetric lighting effect for the requested configuration. The library requires you to check the static FrameGraphVolumetricLightingTask.IsSupported(engine, enableExtinction) before constructing the task, because enabling extinction (or the engine's capabilities) may not be supported on the current hardware/engine setup. Throwing early with this message makes the unsupported configuration explicit instead of failing later in the shader.","triggerScenarios":"Calling new FrameGraphVolumetricLightingTask(name, frameGraph, enableExtinction) when FrameGraphVolumetricLightingTask.IsSupported(frameGraph.engine, enableExtinction) returns false — typically when enableExtinction is true but the engine lacks the required support (e.g. webgl1 or missing extension), or the engine does not support the volumetric lighting effect at all.","commonSituations":"Running Babylon.js on WebGL1 or a device without the needed texture/format support while creating volumetric lighting; enabling the extinction parameter by default without checking hardware capability; code written on a WebGL2 desktop machine then deployed to mobile/limited GPU environments.","solutions":["Before constructing, call FrameGraphVolumetricLightingTask.IsSupported(frameGraph.engine, enableExtinction) and only create the task if it returns true.","If IsSupported fails with enableExtinction = true, retry with enableExtinction = false (extinction defaults to (0,0,0) anyway if you don't need it).","If IsSupported fails even with extinction disabled, skip the volumetric lighting task entirely or fall back to an alternative effect.","Check engine capabilities / upgrade to WebGL2 context if extinction support is required.","Ensure you are on a recent Babylon.js version; support checks and extension requirements have evolved across versions."],"exampleFix":"// before\nconst volumetric = new FrameGraphVolumetricLightingTask(\"volumetric\", frameGraph, true);\n\n// after\nif (FrameGraphVolumetricLightingTask.IsSupported(frameGraph.engine, true)) {\n    const volumetric = new FrameGraphVolumetricLightingTask(\"volumetric\", frameGraph, true);\n} else if (FrameGraphVolumetricLightingTask.IsSupported(frameGraph.engine, false)) {\n    const volumetric = new FrameGraphVolumetricLightingTask(\"volumetric\", frameGraph, false);\n} else {\n    // fall back: no volumetric lighting\n}","handlingStrategy":"validation","validationCode":"if (!FrameGraphVolumetricLightingTask.IsSupported(engine, enableExtinction)) {\n    // fall back or skip creation\n} else {\n    const task = new FrameGraphVolumetricLightingTask(name, frameGraph, enableExtinction);\n}","typeGuard":"function supportsVolumetric(engine: ThinEngine, enableExtinction: boolean): boolean {\n    return FrameGraphVolumetricLightingTask.IsSupported(engine, enableExtinction);\n}","tryCatchPattern":"let task: FrameGraphVolumetricLightingTask | undefined;\ntry {\n    task = new FrameGraphVolumetricLightingTask(name, frameGraph, enableExtinction);\n} catch (e) {\n    console.warn(\"Volumetric lighting unsupported, falling back:\", e);\n    task = undefined;\n}","preventionTips":["Always gate task creation behind FrameGraphVolumetricLightingTask.IsSupported().","Test on your lowest-capability target (WebGL1/mobile) not just desktop WebGL2.","Default enableExtinction to false unless you actually set a non-zero extinction color.","Centralize capability checks in one helper used by all post-process task creation."],"tags":["babylonjs","frame-graph","gpu-capability","webgl","construction"],"backgroundTag":"unsupported-gpu-feature","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}