{"record":{"id":"67b20911403dde5e","repo":"BabylonJS/Babylon.js","slug":"framegraphbloomtask-sourcetexture-is-required","errorCode":null,"errorMessage":"FrameGraphBloomTask: sourceTexture is required","messagePattern":"FrameGraphBloomTask: sourceTexture is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/bloomTask.ts","lineNumber":136,"sourceCode":"        this._downscale = new FrameGraphExtractHighlightsTask(`${name} Downscale`, this._frameGraph, this.bloom._downscale);\r\n        this._blurX = new FrameGraphBlurTask(`${name} Blur X`, this._frameGraph, this.bloom._blurX);\r\n        this._blurY = new FrameGraphBlurTask(`${name} Blur Y`, this._frameGraph, this.bloom._blurY);\r\n        this._merge = new FrameGraphBloomMergeTask(`${name} Merge`, this._frameGraph, this.bloom._merge);\r\n\r\n        this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n    }\r\n\r\n    public override isReady() {\r\n        return this.bloom.isReady();\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphBloomTask\";\r\n    }\r\n\r\n    public record(): void {\r\n        if (this.sourceTexture === undefined) {\r\n            throw new Error(\"FrameGraphBloomTask: sourceTexture is required\");\r\n        }\r\n\r\n        const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n        const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n            size: {\r\n                width: Math.floor(sourceTextureDescription.size.width * this.bloom.scale) || 1,\r\n                height: Math.floor(sourceTextureDescription.size.height * this.bloom.scale) || 1,\r\n            },\r\n            options: {\r\n                createMipMaps: false,\r\n                types: [this._defaultPipelineTextureType],\r\n                formats: [Constants.TEXTUREFORMAT_RGBA],\r\n                samples: 1,\r\n                useSRGBBuffers: [false],\r\n                labels: [\"\"],\r\n            },\r\n            sizeIsPercentage: false,\r","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/bloomTask.ts#L118-L154","documentation":"FrameGraphBloomTask kicks off the bloom pipeline (downsample/blur/upsample) from a source texture; record() throws when task.sourceTexture was never assigned, since the pipeline has nothing to process. Notably the message does not include a task name.","triggerScenarios":"bloomTask.record() with task.sourceTexture === undefined.","commonSituations":"Adding a bloom task to a frame graph but forgetting to bind it to the main render target's output; source task renamed/refactored so the assignment was dropped; building the graph before wiring inputs.","solutions":["Set bloomTask.sourceTexture = mainTargetTask.output (or the desired HDR texture handle) before record().","Ensure the task producing the source texture is recorded prior to the bloom task.","Add a build-time assertion that all post-process task inputs are defined."],"exampleFix":"// before\nconst bloomTask = new FrameGraphBloomTask(\"bloom\", context, { ... });\ncontext.build();\n// after\nconst bloomTask = new FrameGraphBloomTask(\"bloom\", context, { ... });\nbloomTask.sourceTexture = hdrTask.output;\ncontext.build();","handlingStrategy":"validation","validationCode":"if (bloomTask.sourceTexture === undefined) {\n  throw new Error(\"BloomTask.sourceTexture must be set before build\");\n}","typeGuard":"function isBloomReady(task: FrameGraphBloomTask): boolean {\n  return task.sourceTexture !== undefined;\n}","tryCatchPattern":"try {\n  bloomTask.record();\n} catch (e) {\n  if (String(e).includes(\"sourceTexture is required\")) {\n    bloomTask.sourceTexture = hdrTask.output;\n    bloomTask.record();\n  } else throw e;\n}","preventionTips":["Bind bloomTask.sourceTexture to the HDR/main target output at task creation time.","Keep source-texture wiring adjacent to task construction to avoid omissions.","Run a pre-build validation loop over all post-process tasks."],"tags":["frame-graph","post-process","bloom","missing-input"],"backgroundTag":"required-input-missing","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}