XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Backfaces drawing on top off frontfaces.

Last post 05-03-2008 10:02 PM by Mt. 4 replies.
  • 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 In reply to

    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 In reply to

    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 In reply to

    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 In reply to

    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 :)
Page 1 of 1 (5 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG