Backfaces drawing on top off frontfaces.

Last post 05-03-2008, 10:02 PM by M@t. 4 replies.
Sort Posts: Previous Next
  •  05-03-2008, 6:28 PM

    Backfaces drawing on top off frontfaces.

    Hello people.

    My backfaces are drawing on top of my front faces. to get any bit of clarity within my game, ive had to delete the entire backfaces out of the buildings, but ive had to leave some in. is there any way to get xna to draw only what should be visible?

    screenshot:

    oh, and it would be sweet if anyone could tell me how to sort out those textures too...

    Thanks,

    M@t.

  •  05-03-2008, 7:18 PM

    Re: Backfaces drawing on top off frontfaces.

    Probably the spritebatch you are using for you health message is messing with your renderstates.

    Disable the SpriteBatch to see if the rendering goes back to normal...

    To fix it read this.

     

     

  •  05-03-2008, 7:59 PM

    Re: Backfaces drawing on top off frontfaces.

    I cant believe it was that simple!!!

    I just changed my spriteBatch call from

    spriteBatch.Begin(SpriteBlendMode.AlphaBlend);

    to

    spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.SaveState);

     

    worked like a charm!

    Thanks mate, you're a legend.

    M@t.

  •  05-03-2008, 9:57 PM

    Re: Backfaces drawing on top off frontfaces.

    No worries,

    You are probably the 1,000th person to have this issue and the boards are littered with similar questions. I spent about 2 hours debugging this one myself :-).

    Just remember Shawn's warning when you start optimising your code for performance, SaveStateMode.SaveState does slow down your framerates when used a lot...

     

  •  05-03-2008, 10:02 PM

    Re: Backfaces drawing on top off frontfaces.

    I dont use it enough for it to become a problem, if i ever do, ill refer back to his guide :)
View as RSS news feed in XML
©2007 Microsoft Corporation. All rights reserved. Privacy Statement Terms of Use Code of Conduct Feedback