stride3d/stride · error · ArgumentException

Xkfx effect [ ] not found

Error message

Xkfx effect [{0}] not found

What it means

Generate throws ArgumentException when no IShaderMixinBuilder is registered under the root effect name. TryGet fails inside the registry lookup, indicating the requested effect was never registered or its assembly wasn't loaded.

Solutions

  1. Verify the exact effect name spelling against the registered builders (check ShaderMixinManager.Register calls).
  2. Ensure the assembly/module that registers the builder is loaded before generation (referencing Stride.Graphics/Effects modules).
  3. For custom effects, call ShaderMixinManager.Register with your IShaderMixinBuilder before Generate.
  4. If using "RootEffect.ChildEffect" syntax, confirm the root effect is registered.

Example fix

// before
var mixin = ShaderMixinManager.Generate("StrideNotRegisteredEffect", parameters);
// after
if (!ShaderMixinManager.Contains("MyCustomEffect"))
    ShaderMixinManager.Register("MyCustomEffect", new MyEffectBuilder());
var mixin = ShaderMixinManager.Generate("MyCustomEffect", parameters);
Defensive patterns

Strategy: try-catch

Validate before calling

if (!ShaderMixinManager.Contains(effectName))
    throw new InvalidOperationException($"Effect '{effectName}' is not registered; check spelling and module registration");

Try / catch

try { mixin = ShaderMixinManager.Generate(name, parameters); }
catch (ArgumentException ex) when (ex.Message.Contains("not found")) { log.LogError(ex, "Unregistered effect: ensure Register was called and name is correct"); throw; }

Prevention

When it happens

Trigger: Calling Generate with an effect name that has no registered builder; typo in effect name; module that registers builders (e.g. Xkdk/effects registrations) not loaded; "Root.Child" name where the Root part is unregistered.

Common situations: Misspelled PDXFX effect names in materials/assets; missing EffectSystem registration of custom effects; using an effect from a Stride module whose bootstrapping wasn't run in the tool.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/bbfe45ccb28ce00a. Report an issue: GitHub.

Appendix: source

Thrown at sources/shaders/Stride.Shaders.Effects/ShaderMixinManager.cs:107

        /// <exception cref="System.ArgumentException">sdfxEffectName</exception>
        public static ShaderMixinSource Generate(string sdfxEffectName, ParameterCollection properties)
        {
            if (sdfxEffectName == null) throw new ArgumentNullException("sdfxEffectName");

            if (properties == null)
                throw new ArgumentNullException("properties");

            // Get the effect name and child effect name "RootEffectName.ChildEffectName"
            var effectName = GetEffectName(sdfxEffectName);
            var rootEffectName = effectName.Key;
            var childEffectName = effectName.Value;

            IShaderMixinBuilder builder;
            Dictionary<string, IShaderMixinBuilder> builders;
            lock (RegisteredBuilders)
            {
                if (!TryGet(rootEffectName, out builder))
                    throw new ArgumentException(string.Format("Xkfx effect [{0}] not found", rootEffectName), "sdfxEffectName");

                builders = new Dictionary<string, IShaderMixinBuilder>(RegisteredBuilders);
            }

            // TODO cache mixin context and avoid to recreate one (check if if thread concurrency could occur here)
            var mixinTree = new ShaderMixinSource() { Name = sdfxEffectName };
            var context = new ShaderMixinContext(mixinTree, properties, builders) { ChildEffectName = childEffectName };
            try
            {
                builder.Generate(mixinTree, context);
            }
            catch (ShaderMixinDiscardException)
            {
                // We don't rethrow as this exception is on purpose to early exit/escape from a shader mixin
            }
            return mixinTree;
        }

View on GitHub (pinned to 96fad776d2)