Coder Social home page Coder Social logo

Null error in EffectResources.cs about nez HOT 7 CLOSED

prime31 avatar prime31 commented on May 28, 2024
Null error in EffectResources.cs

from nez.

Comments (7)

jbhaywood avatar jbhaywood commented on May 28, 2024 5

I ran into this exact error. Maybe the documentation can be more clear? Right now it says, "...the platform of your project doesnt matter.", which doesn't appear to be true. I had started with a "MonoGame Window Project", but it sounds like Nez doesn't work with that template. You need to use "MonoGame Cross Platform Desktop Project".

from nez.

prime31 avatar prime31 commented on May 28, 2024 2

You have the DirectX version of the MonoGame SDK! If you start with the DesktopGL template it will give you the OpenGL version, which is what Nez requires.

from nez.

prime31 avatar prime31 commented on May 28, 2024

Stick a breakpoint in the method and see which shader it is trying to load. You will want to make sure that you add that shader in your projects Content/nez/effects folder. All the compiled shaders are available in the DefaultContent folder at the root of the repo.

On Jul 11, 2016, at 7:10 PM, RastaCow [email protected] wrote:

Started a new project and started following your Getting Started video on your YouTube channel. At the point where you remove all the default stuff in Monogame such as the LoadContent and such. I run the project and I get a Null error in line 79 of EffectResources.cs Just wondering what the fix was. Here is the error
`internal static byte[] getMonoGameEmbeddedResourceBytes( string name )
{
#if FNA
name = name.Replace( ".ogl.mgfxo", ".fxb" );
#endif

    var assembly = ReflectionUtils.getAssembly( typeof( MathHelper ) );
    using( var stream = assembly.GetManifestResourceStream( name ) )
    {
        using( var ms = new MemoryStream() )
        {
            stream.CopyTo( ms );
            return ms.ToArray();
        }
    }
}`


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from nez.

Zerva5 avatar Zerva5 commented on May 28, 2024

It says it is looking for "Microsoft.Xna.Framework.Graphics.Effect.Resources.SpriteEffect.ogl.mgfxo"

I don't think that is part of Nez?

from nez.

prime31 avatar prime31 commented on May 28, 2024

That is not part of Nez. That is the built-in MonoGame SpriteEffect. That is very, very odd that it is not present. Is your MonoGame install up to date?

One thing you can do to check to make sure the SpriteEffect exists in the MonoGame assembly is to stick the following right before the first using statement:

foreach( var r in assembly.GetManifestResourceNames() )
      Debug.log( "resource name: {0}", r );

Let me know what the output of that is and it may have a clue.

from nez.

Zerva5 avatar Zerva5 commented on May 28, 2024
Log: resource name: Microsoft.Xna.Framework.Graphics.Effect.Resources.AlphaTestEffect.dx11.mgfxo
Log: resource name: Microsoft.Xna.Framework.Graphics.Effect.Resources.BasicEffect.dx11.mgfxo
Log: resource name: Microsoft.Xna.Framework.Graphics.Effect.Resources.DualTextureEffect.dx11.mgfxo
Log: resource name: Microsoft.Xna.Framework.Graphics.Effect.Resources.EnvironmentMapEffect.dx11.mgfxo
Log: resource name: Microsoft.Xna.Framework.Graphics.Effect.Resources.SkinnedEffect.dx11.mgfxo
Log: resource name: Microsoft.Xna.Framework.Graphics.Effect.Resources.SpriteEffect.dx11.mgfxo

Im 99% sure I have the latest version of Monogame. I will update then get back to you

from nez.

Zerva5 avatar Zerva5 commented on May 28, 2024

That did it! Thank you very much!

from nez.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.