0
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

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!

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .