{"record":{"id":"2275788410f5c1bb","repo":"BabylonJS/Babylon.js","slug":"framegraphlightingvolumetask-this-name-shadowg","errorCode":null,"errorMessage":"FrameGraphLightingVolumeTask ${this.name}: shadowGenerator is required","messagePattern":"FrameGraphLightingVolumeTask (.+?): shadowGenerator is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/Misc/lightingVolumeTask.ts","lineNumber":67,"sourceCode":"            particleSystems: [],\r\n        };\r\n    }\r\n\r\n    public override isReady() {\r\n        const isReady = this.lightingVolume.isReady();\r\n        if (isReady) {\r\n            this.lightingVolume._setComputeShaderFastMode(true);\r\n        }\r\n        return isReady;\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphLightingVolumeTask\";\r\n    }\r\n\r\n    public record() {\r\n        if (this.shadowGenerator === undefined) {\r\n            throw new Error(`FrameGraphLightingVolumeTask ${this.name}: shadowGenerator is required`);\r\n        }\r\n\r\n        const light = this.shadowGenerator.light;\r\n\r\n        if (!(light instanceof DirectionalLight)) {\r\n            throw new Error(`FrameGraphLightingVolumeTask ${this.name}: light must be a directional light`);\r\n        }\r\n\r\n        this.lightingVolume.shadowGenerator = this.shadowGenerator.shadowGenerator;\r\n\r\n        const pass = this._frameGraph.addObjectListPass(this.name);\r\n\r\n        pass.setObjectList(this.outputMeshLightingVolume);\r\n        pass.setExecuteFunc(() => {\r\n            this.lightingVolume.update();\r\n        });\r\n\r\n        const passDisabled = this._frameGraph.addObjectListPass(this.name + \"_disabled\", true);\r","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/Misc/lightingVolumeTask.ts#L49-L85","documentation":"FrameGraphLightingVolumeTask builds a lighting volume from a shadow generator, so task.shadowGenerator must be assigned before recording. The task reads shadowGenerator.light to validate and derive the light used for the volume.","triggerScenarios":"Calling lightingVolumeTask.record() with task.shadowGenerator undefined.","commonSituations":"Creating the lighting volume task before creating the shadow generator task whose output it consumes; forgetting to link the shadow generator task output to the lighting volume task; deleting a shadow generator setup during refactoring.","solutions":["Assign task.shadowGenerator = shadowGeneratorTask.output (a FrameGraphShadowGenerator) before record().","Create and record the shadow generator task before the lighting volume task in the graph.","Confirm the shadow generator task actually produced output (it recorded successfully)."],"exampleFix":"// before\nconst lvTask = new FrameGraphLightingVolumeTask(\"lv\", context);\ncontext.build();\n// after\nconst lvTask = new FrameGraphLightingVolumeTask(\"lv\", context);\nlvTask.shadowGenerator = shadowGenTask.output;\ncontext.build();","handlingStrategy":"validation","validationCode":"if (lightingVolumeTask.shadowGenerator === undefined) {\n  throw new Error(\"LightingVolumeTask requires a shadowGenerator task output\");\n}","typeGuard":"function hasShadowGenerator(task: FrameGraphLightingVolumeTask): boolean {\n  return task.shadowGenerator !== undefined && task.shadowGenerator.light !== undefined;\n}","tryCatchPattern":"try {\n  lightingVolumeTask.record();\n} catch (e) {\n  if (String(e).includes(\"shadowGenerator is required\")) {\n    lightingVolumeTask.shadowGenerator = shadowGenTask.output;\n    lightingVolumeTask.record();\n  } else throw e;\n}","preventionTips":["Create the shadow generator task before the lighting volume task and connect output immediately.","Use a graph-builder checklist mapping each task to its required inputs.","Do not delete shadow generator wiring during refactors without updating dependent tasks."],"tags":["frame-graph","shadows","missing-input","validation"],"backgroundTag":"required-input-missing","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}