{"record":{"id":"ac9d25c1e8d5b9ab","repo":"BabylonJS/Babylon.js","slug":"framegraphvolumetriclightingtask-this-name-t","errorCode":null,"errorMessage":"FrameGraphVolumetricLightingTask \"${this.name}\": targetTexture, depthTexture, camera, lightingVolumeMesh and light are required","messagePattern":"FrameGraphVolumetricLightingTask \"(.+?)\": targetTexture, depthTexture, camera, lightingVolumeMesh and light are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.ts","lineNumber":237,"sourceCode":"        return Promise.all([import(\"../../../Shaders/volumetricLightingRenderVolume.vertex\"), import(\"../../../Shaders/volumetricLightingRenderVolume.fragment\")]);\r\n    }\r\n\r\n    public override isReady() {\r\n        return (\r\n            this._renderLightingVolumeMaterial.isReady() &&\r\n            this._clearLightingVolumeTextureTask.isReady() &&\r\n            this._renderLightingVolumeMaterial.isReady() &&\r\n            this._blendLightingVolumeTask.isReady()\r\n        );\r\n    }\r\n\r\n    public override getClassName(): string {\r\n        return \"FrameGraphVolumetricLightingTask\";\r\n    }\r\n\r\n    public record(skipCreationOfDisabledPasses = false) {\r\n        if (this.targetTexture === undefined || this.depthTexture === undefined || this.camera === undefined || this.lightingVolumeMesh === undefined || this.light === undefined) {\r\n            throw new Error(`FrameGraphVolumetricLightingTask \"${this.name}\": targetTexture, depthTexture, camera, lightingVolumeMesh and light are required`);\r\n        }\r\n        if (!this.lightingVolumeMesh.meshes || this.lightingVolumeMesh.meshes.length === 0) {\r\n            throw new Error(`FrameGraphVolumetricLightingTask \"${this.name}\": lightingVolumeMesh is empty`);\r\n        }\r\n\r\n        this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n\r\n        const textureManager = this._frameGraph.textureManager;\r\n\r\n        let lightingVolumeTexture = this.lightingVolumeTexture;\r\n        if (!lightingVolumeTexture) {\r\n            const targetTextureCreationOptions = textureManager.getTextureCreationOptions(this.targetTexture);\r\n\r\n            targetTextureCreationOptions.options.labels = [\"InScattering\"];\r\n            targetTextureCreationOptions.options.samples = 1;\r\n\r\n            lightingVolumeTexture = textureManager.createRenderTargetTexture(`${this.name} - lighting volume texture`, targetTextureCreationOptions);\r\n        }\r","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.ts#L219-L255","documentation":"The record() method of FrameGraphVolumetricLightingTask throws when any of the required task inputs — targetTexture, depthTexture, camera, lightingVolumeMesh, or light — is still undefined. Frame graph tasks must have all their dependencies bound before the frame graph builds/records the render passes; this fail-fast check prevents recording a pass with missing resources.","triggerScenarios":"Calling frameGraphTask.record() (or building the frame graph) before assigning one or more of: task.targetTexture, task.depthTexture, task.camera, task.lightingVolumeMesh, task.light — e.g. forgetting to set task.lightingVolumeMesh = frameGraph.createMeshInputValue(...) or task.light = a FrameGraphLight input.","commonSituations":"Copy-pasting a task setup and forgetting one input; conditional code paths that skip assigning camera or light; renaming/refactoring where an assignment was dropped; building the frame graph before the scene light or mesh is created.","solutions":["Assign all five required properties before record(): targetTexture, depthTexture, camera, lightingVolumeMesh, and light.","Verify the mesh input actually has value: lightingVolumeMesh must come from frameGraph.createMeshInputValue / task.source and not be undefined.","Ensure the light exists in the scene and is passed as a frame-graph light handle before building.","Order your setup code so all resources (textures, camera, mesh, light) are created before frameGraph.build()/task.record().","Log each property before recording to identify which one is undefined."],"exampleFix":"// before\ntask.targetTexture = frameGraph.createTexture(...);\ntask.depthTexture = depthTexture;\ntask.camera = camera;\ntask.record(); // throws: light and lightingVolumeMesh missing\n\n// after\ntask.targetTexture = frameGraph.createTexture(...);\ntask.depthTexture = depthTexture;\ntask.camera = camera;\ntask.lightingVolumeMesh = frameGraph.createMeshInputValue(volumeMesh);\ntask.light = frameGraph.createLightInputValue(sceneLight);\ntask.record();","handlingStrategy":"validation","validationCode":"function volumetricInputsReady(t: FrameGraphVolumetricLightingTask): boolean {\n    return t.targetTexture !== undefined && t.depthTexture !== undefined && t.camera !== undefined && t.lightingVolumeMesh !== undefined && t.light !== undefined;\n}\nif (!volumetricInputsReady(task)) throw new Error(\"volumetric task inputs incomplete\");\ntask.record();","typeGuard":"function isBound<T>(v: T | undefined): v is T {\n    return v !== undefined;\n}","tryCatchPattern":"try {\n    task.record();\n} catch (e) {\n    if ((e as Error).message.includes(\"are required\")) {\n        console.error(\"Missing volumetric task inputs:\", {\n            targetTexture: task.targetTexture,\n            depthTexture: task.depthTexture,\n            camera: task.camera,\n            lightingVolumeMesh: task.lightingVolumeMesh,\n            light: task.light,\n        });\n    } else throw e;\n}","preventionTips":["Assign every required input immediately after constructing the task, before build().","Wrap task setup in a helper function so no input can be skipped.","Never call frameGraph.build() before all task inputs are assigned.","Keep a checklist: targetTexture, depthTexture, camera, lightingVolumeMesh, light."],"tags":["babylonjs","frame-graph","missing-input","validation","record"],"backgroundTag":"missing-required-parameter","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}