stride3d/stride · error · ArgumentOutOfRangeException
Radius cannot be < 1
Error message
Radius cannot be < 1
What it means
Thrown by the GaussianBlur.Radius setter when the assigned value is less than 1. The radius (in pixels, per the user doc) determines the size of the Gaussian kernel; a radius below 1 would produce an empty/invalid kernel, so the setter rejects it with ArgumentOutOfRangeException before storing the value.
Solutions
- Clamp to at least 1: Radius = Math.Max(1, value)
- Fix the radius computation to guarantee >= 1 (e.g. Math.Max(1, (int)Math.Ceiling(x)))
- Remove/disable the blur effect entirely if no blur is wanted
Example fix
// before blur.Radius = (int)(radiusScale * 3f); // after blur.Radius = Math.Max(1, (int)(radiusScale * 3f));
Defensive patterns
Strategy: validation
Validate before calling
if (radius < 1) radius = 1; blur.Radius = radius;
Type guard
bool IsValidGaussianRadius(int r) => r >= 1;
Try / catch
try { blur.Radius = value; } catch (ArgumentOutOfRangeException) { blur.Radius = 1; } Prevention
- Clamp radii with Math.Max(1, value) before assignment
- Beware integer truncation rounding computed radii down to 0
- Validate radii from external configs before applying
When it happens
Trigger: Assigning 0 or a negative number to GaussianBlur.Radius, or computing the radius from a formula that can yield 0 (e.g. (int)(0.5 * scale) at small scales).
Common situations: Integer truncation of a float radius rounding down to 0 at low resolutions; tuning experiments; migrating from effects that allowed radius 0.
Related errors
- SigmaRatio cannot be < 0.0f
- DoF configuration needs at least one blur level!
- Last blurriest level must have a CoC of 1.0!
- levelCoCValues and levelDownscaleFactors must be arrays of…
- Radius cannot be < 0
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/c88fd547b185b76e.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Rendering/Rendering/Images/GaussianBlur/GaussianBlur.cs:57
}
/// <summary>
/// Gets or sets the radius.
/// </summary>
/// <value>The radius.</value>
/// <userdoc>The radius of the Gaussian in pixels</userdoc>
[DataMember(10)]
public int Radius
{
get
{
return radius;
}
set
{
if (value < 1)
{
throw new ArgumentOutOfRangeException("Radius cannot be < 1");
}
radius = value;
}
}
/// <summary>
/// Gets or sets the sigma ratio. The sigma ratio is used to calculate the sigma based on the radius: The actual
/// formula is <c>sigma = radius / SigmaRatio</c>. The default value is 2.0f.
/// </summary>
/// <value>The sigma ratio.</value>
/// <userdoc>The sigma ratio of the Gaussian. The sigma ratio is used to calculate the sigma of the Gaussian.
/// The actual formula is <c>sigma = radius / SigmaRatio</c></userdoc>
[DataMember(20)]
public float SigmaRatio
{
get
{View on GitHub (pinned to 96fad776d2)