{"record":{"id":"290e55c373fee505","repo":"stride3d/stride","slug":"fogfiltername","errorCode":null,"errorMessage":"fogFilterName","messagePattern":"fogFilterName","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/Fog/Fog.cs","lineNumber":35,"sourceCode":"        private readonly ImageEffectShader fogFilter;\n        private Texture depthTexture;\n        private float zMin, zMax;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Fog\"/> class.\n        /// </summary>\n        public Fog()\n            : this(\"FogEffect\") \n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Fog\"/> class.\n        /// </summary>\n        /// <param name=\"shaderName\">Name of the fog shader.</param>\n        public Fog(string shaderName) : base(shaderName) \n        {\n            if (shaderName == null) throw new ArgumentNullException(\"fogFilterName\");\n            fogFilter = new ImageEffectShader(shaderName);\n        }\n\n        [DataMember(10)]\n        public float Density { get; set; } = 0.1f;\n\n        [DataMember(20)]\n        public Color3 Color { get; set; } = new Color3(1.0f);\n\n        [DataMember(30)]\n        public float FogStart { get; set; } = 10f;\n\n        [DataMember(40)]\n        public bool SkipBackground { get; set; } = false;\n\n        protected override void InitializeCore() \n        {\n            base.InitializeCore();","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/Fog/Fog.cs#L17-L53","documentation":"Argument-null validation in the Fog(string shaderName) constructor: shaderName is null. The base ImageEffectShader is constructed from this name to load the fog effect; without a shader name the effect cannot locate its shader, so the constructor rejects the null input. (The parameterless Fog() delegates with the default name \"FogEffect\".)","triggerScenarios":"new Fog(null) or passing a shader name variable that is null (e.g. from a missing config field or failed lookup).","commonSituations":"Loading the shader name from settings/serialization that returned null; renaming a shader so a lookup fails before the constructor; copying examples where a constant was accidentally removed.","solutions":["Pass a valid fog shader name string to the constructor","Check the config/lookup that produced the null name and fix it or supply a default (e.g. \"FogEffect\")","Add a null check/default before constructing Fog"],"exampleFix":"// before\nvar fog = new Fog(settings.FogShaderName); // may be null\n// after\nvar fog = new Fog(settings.FogShaderName ?? \"FogEffect\");","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(shaderName)) shaderName = \"FogEffect\"; var fog = new Fog(shaderName);","typeGuard":"bool IsValidShaderName(string s) => !string.IsNullOrEmpty(s);","tryCatchPattern":"try { fog = new Fog(shaderName); } catch (ArgumentNullException) { fog = new Fog(\"FogEffect\"); }","preventionTips":["Check config/serialized shader names for null before constructing","Provide sensible defaults for optional shader name fields","Use string constants for built-in shader names instead of bare literals"],"tags":["csharp","argumentnullexception","fog","rendering"],"backgroundTag":"null-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}