{"record":{"id":"5c65991414d77ac8","repo":"stride3d/stride","slug":"only-cubemaps-are-currently-supported-as-input","errorCode":null,"errorMessage":"Only cubemaps are currently supported as input","messagePattern":"Only cubemaps are currently supported as input","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGX.cs","lineNumber":83,"sourceCode":"                if (!MathUtil.IsPow2(value))\n                    throw new ArgumentException(\"The provided value should be a power of 2\");\n\n                samplingsCount = Math.Max(1, value);\n            }\n        }\n\n        protected override void DrawCore(RenderDrawContext context)\n        {\n            var output = PrefilteredRadiance;\n            if (output == null || (output.ViewDimension != TextureDimension.Texture2D && output.ViewDimension != TextureDimension.TextureCube) || output.ArraySize != 6)\n                throw new NotSupportedException(\"Only array of 2D textures are currently supported as output\");\n\n            if (!output.IsUnorderedAccess || output.IsRenderTarget)\n                throw new NotSupportedException(\"Only non-rendertarget unordered access textures are supported as output\");\n\n            var input = RadianceMap;\n            if (input == null || input.Dimension != TextureDimension.TextureCube)\n                throw new NotSupportedException(\"Only cubemaps are currently supported as input\");\n\n            var roughness = 0f;\n            var faceCount = output.ArraySize;\n            var levelSize = new Int2(output.Width, output.Height);\n            var mipCount = MipmapGenerationCount == 0 ? output.MipLevelCount : MipmapGenerationCount;\n\n            for (int l = 0; l < mipCount; l++)\n            {\n                if (l == 0 && DoNotFilterHighestLevel && input.Width >= output.Width)\n                {\n                    var inputLevel = MathUtil.Log2(input.Width / output.Width);\n                    for (int f = 0; f < 6; f++)\n                    {\n                        var inputSubresource = inputLevel + f * input.MipLevelCount;\n                        var outputSubresource = 0 + f * output.MipLevelCount;\n                        context.CommandList.CopyRegion(input, inputSubresource, null, output, outputSubresource);\n                    }\n                }","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGX.cs#L65-L101","documentation":"RadiancePrefilteringGGX.DrawCore throws NotSupportedException when RadianceMap is null or its Dimension is not TextureCube. The prefiltering shader importance-samples the environment by cube-face lookups, so only a cubemap input is implemented; 2D panorama or array inputs are rejected.","triggerScenarios":"Leaving RadianceMap unset, or assigning a 2D texture / texture array (e.g. equirectangular panorama not yet converted to cubemap) as RadianceMap.","commonSituations":"Loading an HDR panorama and feeding it directly into the prefilter without the pano-to-cubemap conversion pass; asset pipeline emitting non-cube environment textures; forgetting to set RadianceMap before rendering.","solutions":["Convert the equirectangular panorama to a cubemap first (Stride's pano-to-cube pass), then assign it to RadianceMap.","Ensure RadianceMap is a Texture with Dimension == TextureCube.","Assign RadianceMap before running the prefilter in your IBL setup."],"exampleFix":"// before\nprefilter.RadianceMap = panoramaTexture2D; // 2D equirect\n// after\nvar cube = panoramaTexture2D.ToCubeView(); // run Stride's pano->cubemap conversion\nprefilter.RadianceMap = cube;","handlingStrategy":"validation","validationCode":"if (input == null || input.Dimension != TextureDimension.TextureCube)\n    throw new InvalidOperationException(\"RadianceMap must be a cubemap texture\");","typeGuard":"bool IsCubemap(Texture t) => t != null && t.Dimension == TextureDimension.TextureCube;","tryCatchPattern":"try { prefilter.Render(context); }\ncatch (NotSupportedException ex) { Log.Error(\"RadianceMap must be a cubemap; convert panoramas first.\", ex); }","preventionTips":["Run the equirectangular-to-cubemap conversion before prefiltering.","Verify texture dimension when loading environment assets.","Never assign null RadianceMap; allocate the cubemap in setup."],"tags":["rendering","pbr","ibl","cubemap","stride"],"backgroundTag":"unsupported-operation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}