Spritebatch and Foreground HUD Problem

Jun 26, 2007 at 2:10 PM
Hi,

I have a problem with the Spritebatch and the ACL.

I want to draw a HUD with Spritebatch and some models with the ACL. Please take a look at this picture:

http://d0x.gmxhome.de/ACL_SPRITEBATCH.JPG

I marked the bugs.

The ACL modells are on the Foreground. But models, that i drawed on the normal way are on the background.

The Terrian and the doll are dwared on the normal way.
The other modells with the ACL.

Maybe you can help.

( I insert the following code:

graphics.GraphicsDevice.RenderState.DepthBufferEnable = true;
graphics.GraphicsDevice.RenderState.AlphaBlendEnable = false;
graphics.GraphicsDevice.RenderState.AlphaTestEnable = false;
graphics.GraphicsDevice.SamplerStates0.AddressU = TextureAddressMode.Wrap;
graphics.GraphicsDevice.SamplerStates0.AddressV = TextureAddressMode.Wrap;

to restore the GraphicsDevice settings, before drawing 3D Content.)
Jul 2, 2007 at 3:39 AM
Edited Jul 2, 2007 at 3:41 AM
LOL I have the same Problem.
How to fix it?
Jul 2, 2007 at 8:56 AM
I had found a way to fix it.
Jul 4, 2007 at 9:08 AM
Tell us how to fix it please :)
Jul 6, 2007 at 2:25 AM
Edited Jul 6, 2007 at 2:29 AM
As ShawnHargreaves said"If you are mixing 3D rendering with 2D objects using SpriteBatch, you may notice that your 3D graphics no longer draw correctly after you have rendered sprites. This is because the SpriteBatch changes several device renderstates to values that may not be appropriate for drawing in 3D."

So I add the code:
SpriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);

And I also found the bug what you say,I try to add the code:
Animator.Visible = false;
It works fine for me up to now.

But I don't think it's a good way....wait for next release.....:(

Yeah,I think we can use MSN,do u think so?
Aug 16, 2007 at 10:20 PM


robin101 wrote:
As ShawnHargreaves said"If you are mixing 3D rendering with 2D objects using SpriteBatch, you may notice that your 3D graphics no longer draw correctly after you have rendered sprites. This is because the SpriteBatch changes several device renderstates to values that may not be appropriate for drawing in 3D."

So I add the code:
SpriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);

And I also found the bug what you say,I try to add the code:
Animator.Visible = false;
It works fine for me up to now.

But I don't think it's a good way....wait for next release.....:(

Yeah,I think we can use MSN,do u think so?


i have not managed to fixed it using this way. is there anything else you are doing? maybe paste some code please?