{"record":{"id":"672e600b600f7f0a","repo":"stride3d/stride","slug":"only-array-of-2d-textures-are-currently-supported-as-output","errorCode":null,"errorMessage":"Only array of 2D textures are currently supported as output","messagePattern":"Only array of 2D textures are currently supported as output","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGX.cs","lineNumber":76,"sourceCode":"        {\n            get { return samplingsCount; }\n            set\n            {\n                if (value > 1024)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                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);","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGX.cs#L58-L94","documentation":"RadiancePrefilteringGGX.DrawCore throws NotSupportedException when PrefilteredRadiance is null, is not a 2D-array or cube texture view, or has ArraySize != 6. The prefiltering compute shader writes one mip chain per face of a 6-slice array (cubemap faces), so only that output layout is implemented.","triggerScenarios":"Assigning a plain Texture2D, a texture array with a slice count other than 6, or leaving PrefilteredRadiance null before rendering the prefilter.","commonSituations":"Creating the prefiltered target as an ordinary 2D texture instead of a 6-slice array; generating the output texture with a mip-count/ArraySize mismatch; forgetting to allocate the output texture before running IBL prefiltering.","solutions":["Create PrefilteredRadiance as a Texture2D with ArraySize = 6 (or a cubemap), bindable as unordered access.","Ensure the texture is allocated and assigned to the PrefilteredRadiance property before render.","Check ViewDimension is Texture2D or TextureCube and ArraySize equals 6."],"exampleFix":"// before\nvar output = Texture.New2D(device, 256, 256, PixelFormat.Rgba16_Float, TextureFlags.ShaderResource); // plain 2D\nprefilter.PrefilteredRadiance = output;\n// after\nvar output = Texture.New2D(device, 256, 256, PixelFormat.Rgba16_Float, TextureFlags.ShaderResource | TextureFlags.UnorderedAccess, mipCount: 9, arraySize: 6);\nprefilter.PrefilteredRadiance = output;","handlingStrategy":"validation","validationCode":"if (output == null || (output.ViewDimension != TextureDimension.Texture2D && output.ViewDimension != TextureDimension.TextureCube) || output.ArraySize != 6)\n    throw new InvalidOperationException(\"PrefilteredRadiance must be a 2D array/cube texture with ArraySize == 6\");","typeGuard":"bool IsValidPrefilterOutput(Texture t) => t != null && (t.ViewDimension == TextureDimension.Texture2D || t.ViewDimension == TextureDimension.TextureCube) && t.ArraySize == 6;","tryCatchPattern":"try { prefilter.Render(context); }\ncatch (NotSupportedException ex) { Log.Error(\"PrefilteredRadiance must be a 6-slice 2D array (cubemap) texture.\", ex); }","preventionTips":["Create the prefiltered radiance target with arraySize: 6 and UnorderedAccess flags.","Allocate the output texture during IBL setup, before first render.","Share a single factory function for prefilter output textures."],"tags":["rendering","pbr","ibl","unsupported","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"}