Sign in to follow this  

Render appears black Monogame

This topic is 827 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

This topic is 827 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this