Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How,can I disable coloring when texture is applied, because right now the texture is being colored over.

foreach (BasicEffect effect in mesh.Effects)
{
    effect.TextureEnabled = textureApplied;

    if(textureApplied)
        effect.Texture = Texture2D.FromStream(GraphicsDevice,System.IO.File.OpenRead(texturePath));
    else
    {
        effect.DiffuseColor = ti.DiffuseColor;
        effect.EmissiveColor = ti.EmissiveColor;
    }
    ...
}
mesh.Draw();

Also, is there any easy way for xna to export models? Or do I have to write my own?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

First, set the DiffuseColor and EmissiveColor to Color.White when textureApplied is true. And please cache the result of Texture2D.FromStream and don't call it every frame!

share|improve this answer
    
Thanks, and I know, I just used it as a test :p –  user1806687 Nov 26 '12 at 16:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.