{"record":{"id":"3d620ad2f791bd99","repo":"stride3d/stride","slug":"antialiasshadername","errorCode":null,"errorMessage":"antialiasShaderName","messagePattern":"antialiasShaderName","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/AntiAliasing/FXAAEffect.cs","lineNumber":69,"sourceCode":"\n        /// <summary>\n        /// Gets or sets a value indicating whether the luminance will be retrieved from the alpha channel of the input color. Otherwise, the green component of the input color is used as a luminance.\n        /// </summary>\n        /// <value><c>true</c> the luminance will be retrieved from the alpha channel of the input color. Otherwise, the green component of the input color is used as a luminance.</value>\n        /// <userdoc>Retrieve the luminance from the alpha channel of the input color. Otherwise, use the green component of the input color as an approximation of the luminance.</userdoc>\n        [DataMember(30)]\n        [DefaultValue(true)]\n        [Display(\"Input luminance from alpha\")]\n        public bool InputLuminanceInAlpha { get; set; }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"FXAAEffect\"/> class.\n        /// </summary>\n        /// <param name=\"antialiasShaderName\">Name of the antialias shader.</param>\n        /// <exception cref=\"System.ArgumentNullException\">antialiasShaderName</exception>\n        public FXAAEffect(string antialiasShaderName) : base(antialiasShaderName)\n        {\n            if (antialiasShaderName == null) throw new ArgumentNullException(\"antialiasShaderName\");\n        }\n\n        public static (int, int) GetQualityRange(DitherType dither)\n        {\n            // Returns valid ranges for FXAA_QUALITY__PRESET (as in FXAAShader.sdsl)\n            switch (dither)\n            {\n                case DitherType.Medium:\n                    return (0, 5);\n                case DitherType.Low:\n                    return (0, 9);\n                case DitherType.None:\n                    return (9, 9);\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(Dither));\n            }\n        }\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/AntiAliasing/FXAAEffect.cs#L51-L87","documentation":"The FXAAEffect(string antialiasShaderName) constructor throws ArgumentNullException when the shader name is null. FXAA is implemented as a shader effect that must be instantiated by name, so a null name would fail downstream when the effect is compiled. The check happens before the value reaches the base class constructor body.","triggerScenarios":"new FXAAEffect(null) — constructing the anti-aliasing effect without a shader name, typically when the name is read from configuration or derived dynamically and ends up null.","commonSituations":"Configuration keys for post-effects not set; loading effect names from a settings file that omits the FXAA entry; refactoring where the default shader name constant was removed.","solutions":["Pass a valid shader name, e.g. new FXAAEffect(\"FXAAEffect\") or the standard Stride FXAA shader name.","If the name comes from config, validate it is non-null/non-empty before constructing the effect.","Fall back to a default shader name constant when the configured value is missing."],"exampleFix":"// before\nvar fxaa = new FXAAEffect(settings.FxaaShaderName); // null\n// after\nvar shaderName = settings.FxaaShaderName ?? \"FXAAEffect\";\nvar fxaa = new FXAAEffect(shaderName);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(shaderName)) shaderName = \"FXAAEffect\";\nvar fxaa = new FXAAEffect(shaderName);","typeGuard":"bool IsValidShaderName(string s) => !string.IsNullOrEmpty(s);","tryCatchPattern":"try { var fxaa = new FXAAEffect(name); }\ncatch (ArgumentNullException ex) { Log.Error(ex, \"FXAA shader name missing\"); }","preventionTips":["Use named constants for shader names","Validate config-provided effect names before construction","Provide default fallback shader names"],"tags":["null-argument","shader","antialiasing"],"backgroundTag":"null-argument","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"}