{"record":{"id":"ebabe8aed70113a8","repo":"BabylonJS/Babylon.js","slug":"framegraphiblshadowsvoxelizationtask-this-name-ebabe8","errorCode":null,"errorMessage":"FrameGraphIblShadowsVoxelizationTask ${this.name}: voxel renderer texture is unavailable","messagePattern":"FrameGraphIblShadowsVoxelizationTask (.+?): voxel renderer texture is unavailable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.ts","lineNumber":269,"sourceCode":"            bounds.min = Vector3.Minimize(bounds.min, localBounds.min);\r\n            bounds.max = Vector3.Maximize(bounds.max, localBounds.max);\r\n        }\r\n\r\n        const size = bounds.max.subtract(bounds.min);\r\n        this.voxelGridSize = Math.max(size.x, size.y, size.z);\r\n\r\n        const halfSize = this.voxelGridSize / 2.0;\r\n        const centerOffset = bounds.max.add(bounds.min).multiplyByFloats(-0.5, -0.5, -0.5);\r\n        const invWorldScaleMatrix = Matrix.Compose(new Vector3(1.0 / halfSize, 1.0 / halfSize, 1.0 / halfSize), new Quaternion(), Vector3.Zero());\r\n        const invTranslationMatrix = Matrix.Compose(new Vector3(1.0, 1.0, 1.0), new Quaternion(), centerOffset);\r\n        invTranslationMatrix.multiplyToRef(invWorldScaleMatrix, this.worldScaleMatrix);\r\n    }\r\n\r\n    private _updateOutputTextureHandlesFromRenderer(): void {\r\n        const voxelTexture = this._voxelRenderer!.getVoxelGrid();\r\n        const voxelInternalTexture = voxelTexture.getInternalTexture();\r\n        if (!voxelInternalTexture) {\r\n            throw new Error(`FrameGraphIblShadowsVoxelizationTask ${this.name}: voxel renderer texture is unavailable`);\r\n        }\r\n\r\n        this._voxelGridTextureHandle = this._frameGraph.textureManager.importTexture(`${this.name} Voxel Grid`, voxelInternalTexture, this._voxelGridTextureHandle);\r\n        this._frameGraph.textureManager.resolveDanglingHandle(this.outputVoxelGridTexture, this._voxelGridTextureHandle);\r\n    }\r\n}\r\n","sourceCodeStart":251,"sourceCodeEnd":276,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.ts#L251-L276","documentation":"FrameGraphIblShadowsVoxelizationTask needs the voxel grid texture from its internal voxel renderer to import it into the frame graph and expose it as an output handle. This error is thrown in _updateOutputTextureHandlesFromRenderer when _voxelRenderer.getVoxelGrid().getInternalTexture() returns null, meaning the GPU-side voxel texture has not been created (or was released) at the moment record() or the voxelization observer runs.","triggerScenarios":"record() or _attachVoxelizationObserver invokes _updateOutputTextureHandlesFromRenderer while the voxel renderer's VoxelGrid has no internal (GPU) texture — e.g. the task was recorded before the engine allocated the voxel grid resource, or the texture was disposed/released.","commonSituations":"Recording the IBL shadows voxelization pass very early in frame-graph setup; a failed or skipped voxel grid creation due to unsupported engine/texture formats; disposing the voxel renderer but keeping the task recorded; WebGPU/WebGL capability issues preventing 3D texture allocation.","solutions":["Ensure the IblShadows voxel renderer is fully initialized and its voxel grid created before recording the voxelization task (record after engine/scene resources are ready).","Verify the engine supports the required 3D texture format (WebGPU or WebGL2 with texture storage extensions) so getInternalTexture() is non-null.","Check that the voxel renderer was not disposed and voxelization was not disabled/disposed before record.","Wrap task setup in a ready-check: only add/record the task once the renderer reports ready."],"exampleFix":"// before\nframeGraph.addTask(voxelizationTask); // recorded too early\nvoxelizationTask.record();\n\n// after\nif (voxelizationTask._voxelRenderer.getVoxelGrid().getInternalTexture()) {\n    frameGraph.addTask(voxelizationTask);\n} else {\n    scene.whenReadyAsync().then(() => frameGraph.addTask(voxelizationTask));\n}","handlingStrategy":"validation","validationCode":"const voxelGrid = task._voxelRenderer?.getVoxelGrid?.();\nif (!voxelGrid || !voxelGrid.getInternalTexture()) {\n    throw new Error('Voxel grid GPU texture not ready; defer recording the voxelization task');\n}","typeGuard":"function hasVoxelInternalTexture(grid: unknown): grid is { getInternalTexture(): NonNullable<ReturnType<InternalTexture['getInternalTexture']>> } {\n    return !!grid && typeof (grid as any).getInternalTexture === 'function' && !!(grid as any).getInternalTexture();\n}","tryCatchPattern":"try {\n    frameGraph.addTask(voxelizationTask);\n} catch (e) {\n    if (String(e).includes('voxel renderer texture is unavailable')) {\n        scene.whenReadyAsync().then(() => frameGraph.addTask(voxelizationTask));\n    } else throw e;\n}","preventionTips":["Record IBL shadows tasks only after scene/engine readiness (scene.whenReadyAsync).","Verify engine support for 3D storage textures before enabling IBL shadows voxelization.","Never dispose the voxel renderer while its frame graph tasks are still recorded."],"tags":["babylonjs","frame-graph","ibl-shadows","texture","gpu-resources"],"backgroundTag":"gpu-texture-not-created","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}