Jump to content
  • Advertisement
Sign in to follow this  
mousetail

Render appears black Monogame

This topic is 1112 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Except for this one random model, Monogame refuses to texture or even color my models. I have been researching, trying things for a few hours now, and I feel I am justified to ask the question here now. I tried enabling or disabling textures, lighting, vertex colors, ambient. I tried exporting my FBX in ASCII, binary, using fbx converter. I tried meshes from a earlier XNA project that I am sure that work in there. My research found it may be a problem with the Monogame pipeline, and that you need to compile the project using a old XNA content project, but then say if you export ASCII from blender or use the FBX converter you should be fine. Duos anyone have any experiment circumventing the problem? Or a possible way to check how the one mesh that will work is different and how to convert the rest in the same format? When I look at the FBX files, the one that works seems much smaller then the rest, but that's logical since it contains only 2 quads.

 

My render code: (I have tried various combinations of uncommenting lines, including some that I have removed)

        public virtual void draw(Camera camera){
            foreach (ModelMesh meshr in model.Meshes){
                foreach (BasicEffect effect in meshr.Effects){
                    //effect.CurrentTechnique = effect.Techniques["Textured"];
                    //effect.VertexColorEnabled = false;
                    //effect.EnableDefaultLighting();
                    //effect.AmbientLightColor = new Vector3(0.5F, 0.5F, 0.5F);
                    effect.Texture = texture;
                    effect.TextureEnabled = true;

                    effect.World=transform.getMatrix();
                    effect.View=camera.view;
                    effect.Projection=camera.projection;
                    //effect.CurrentTechnique = new EffectTechnique();
                    this.effect = effect;
                }
                meshr.Draw();
            }

        }

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!