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.

Here is a code sample:

        blockModel = game.Content.Load<Model>("Models/Cubes/Cube"); //this is a .fbx file, made in blender

        absoluteBlockTransforms = new Matrix[blockModel.Bones.Count];
        blockModel.CopyAbsoluteBoneTransformsTo(absoluteBlockTransforms);

        /*
        foreach (ModelMesh mesh in blockModel.Meshes)
        {
            foreach (BasicEffect effect in mesh.Effects)
            {
                effect.Texture = game.Content.Load<Texture2D>("Textures/Cubes/CubeLayout"); //this is the texture it's already using, but copy-pasted into a different directory
            }
        }*/

This looks fineGood image

Now if I uncomment the lines above, somehow everything gets screwed up?

Bad image

Somehow just setting the Texture property messes something up, but I'm not sure what exactly (aside from the symptoms). Note that framerate doesn't actually change; the small difference is just a coincidence. Also, the multisampling property is set after this is called, so it's not an issue of it somehow changing the graphics property.

share|improve this question
    
Is it just me or has the lighting disappeared on the second one? –  Polar Mar 18 '13 at 18:06
    
Definitely something weird going on, but that might be something added by Blender. Lighting is disabled for these models. I think it's more of a fade effect? –  Richard Rast Mar 18 '13 at 18:09
    
Well, I'd use it as a starting point to investigate yourself what's going wrong. It makes your question look much more professional if you can show you've done your own research. –  Polar Mar 18 '13 at 18:11
2  
Is it possible that you aren't generating the mipmaps for this loaded texture or that when you brought it into xna the content importer set the color space to DXT? –  RobCurr Mar 18 '13 at 18:46
1  
I don't think it's the lighting that's changed, it's the texture mipmapping. What's your actual question? What are you trying to solve? –  Byte56 Mar 18 '13 at 19:23
show 2 more comments

1 Answer

up vote 1 down vote accepted

As was eluded to in the comments, the problem is that in the second half your textures are missing mipmaps.

share|improve this answer
2  
...and Tetrad comes in for the steal :p –  RobCurr Mar 18 '13 at 23:13
    
+1, correct answer. Though I was thinking more along the lines of too localized. –  Byte56 Mar 18 '13 at 23:17
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.