单人游戏自定义效果
Monogame Custom Effect
我和我的朋友们想要在 Monogame 管道的 "build content" 过程中实现一个连接到网格的自定义效果。也就是说,如果一个模型由 10 个不同的网格组成,每个网格都有自己的效果,这将使我们的生活变得更加轻松。
在我看来,这样做曾经是微不足道的,比如:https://blogs.msdn.microsoft.com/shawnhar/2006/12/07/rendering-a-model-with-a-custom-effect/
不幸的是,现在这种做事的方式对我们不起作用。我们编写了自定义模型处理器、自定义模型 material 处理器和自定义纹理处理器。
EffectMaterialContent myMaterial = new EffectMaterialContent();
myMaterial.Effect = new ExternalReference<EffectContent>(effectPath);
所以我们得到以下异常:
{"Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ReflectiveReader`1[[Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectMaterialContent, MonoGame.Framework.Content.Pipeline, Version=3.6.0.199, Culture=neutral, PublicKeyToken=null]] (Microsoft.Xna.Framework.Content.ReflectiveReader`1[[Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectMaterialContent, MonoGam e.Framework.Content.Pipeline]])"}
似乎有一种简单的方法可以做到这一点,但我们却找不到。
我们将非常感谢您的帮助!
我相信我们或多或少地解决了这个问题。这是我在 Monogame 社区论坛上发布的一个问题。它无论如何都不完整,但我相信它提供了对潜在问题的一个很好的一般理解。
我和我的朋友们想要在 Monogame 管道的 "build content" 过程中实现一个连接到网格的自定义效果。也就是说,如果一个模型由 10 个不同的网格组成,每个网格都有自己的效果,这将使我们的生活变得更加轻松。
在我看来,这样做曾经是微不足道的,比如:https://blogs.msdn.microsoft.com/shawnhar/2006/12/07/rendering-a-model-with-a-custom-effect/
不幸的是,现在这种做事的方式对我们不起作用。我们编写了自定义模型处理器、自定义模型 material 处理器和自定义纹理处理器。
EffectMaterialContent myMaterial = new EffectMaterialContent();
myMaterial.Effect = new ExternalReference<EffectContent>(effectPath);
所以我们得到以下异常:
{"Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ReflectiveReader`1[[Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectMaterialContent, MonoGame.Framework.Content.Pipeline, Version=3.6.0.199, Culture=neutral, PublicKeyToken=null]] (Microsoft.Xna.Framework.Content.ReflectiveReader`1[[Microsoft.Xna.Framework.Content.Pipeline.Graphics.EffectMaterialContent, MonoGam e.Framework.Content.Pipeline]])"}
似乎有一种简单的方法可以做到这一点,但我们却找不到。 我们将非常感谢您的帮助!
我相信我们或多或少地解决了这个问题。这是我在 Monogame 社区论坛上发布的一个问题。它无论如何都不完整,但我相信它提供了对潜在问题的一个很好的一般理解。