{"record":{"id":"d72138d5a35b78ef","repo":"stride3d/stride","slug":"only-cubemaps-are-currently-supported-as-input-d72138","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/RadiancePrefilteringGGXNoCompute.cs","lineNumber":86,"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.IsRenderTarget)\n                throw new NotSupportedException(\"Only render targets are supported as output\");\n\n            var input = RadianceMap;\n            if (input == null || input.ViewDimension != 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 mipLevel = 0; mipLevel < mipCount; mipLevel++)\n            {\n                for (int faceIndex = 0; faceIndex < faceCount; faceIndex++)\n                {\n                    using var outputView = output.ToTextureView(ViewType.Single, faceIndex, mipLevel);\n                    var inputLevel = MathUtil.Log2(input.Width / output.Width);\n                    if (mipLevel == 0 && DoNotFilterHighestLevel)\n                    {\n                        if (input.Width >= output.Width && inputLevel < input.MipLevelCount && input.Format == output.Format) // TODO: This comparison excludes sRGB to/from non-sRGB, which are indistinguishable in memory\n                        {\n                            // Optimization: make a simple copy of the texture when possible\n                            var inputSubresource = inputLevel + faceIndex * input.MipLevelCount;","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGXNoCompute.cs#L68-L104","documentation":"RadiancePrefilteringGGXNoCompute expects RadianceMap to be a cubemap texture (ViewDimension == TextureCube). DrawCore throws NotSupportedException when the input is null or any other view dimension (e.g. Texture2D).","triggerScenarios":"Drawing the prefilter with RadianceMap set to a 2D texture or panorama, or leaving RadianceMap unset.","commonSituations":"Trying to prefilter an equirectangular HDRI directly instead of first converting it to a cubemap; wiring up the wrong texture slot in the IBL generation chain.","solutions":["Assign a cubemap texture (ViewDimension TextureCube, render-targetable if you also generate mips) to RadianceMap.","Convert equirectangular panoramas to a cubemap first (e.g. via the equiangular-to-cube effect).","Check input.ViewDimension == TextureDimension.TextureCube before drawing."],"exampleFix":"// before\nprefilter.RadianceMap = equirectangularTexture; // Texture2D\n// after\nprefilter.RadianceMap = cubemapTexture; // ViewDimension == TextureCube","handlingStrategy":"validation","validationCode":"if (input == null || input.ViewDimension != TextureDimension.TextureCube) throw new ArgumentException(\"RadianceMap must be a cubemap texture\");","typeGuard":"bool IsCubemap(Texture t) => t?.ViewDimension == TextureDimension.TextureCube;","tryCatchPattern":"try { prefilter.Draw(context); } catch (NotSupportedException ex) { log.Error(ex, \"Convert the environment map to a cubemap before prefiltering\"); }","preventionTips":["Convert equirectangular HDRIs to cubemaps as a pipeline step.","Assert ViewDimension == TextureCube wherever RadianceMap is assigned."],"tags":["stride","rendering","cubemap","unsupported-operation"],"backgroundTag":"incompatible-source-type","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}