Sign in to follow this  
quibb_user

[XNA] DepthBufferEnable problem

Recommended Posts

Hey! I have some serious problem with the DepthBuffer. [CODE] protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(ClearOptions.Target, Color.Black, 1.0f, 0); spriteBatch.Begin(); spriteBatch.DrawString(fontArial, "Camera Position: " + _Camera.Position, new Vector2(0, 0), Color.White); spriteBatch.DrawString(fontArial, "\nCamera Target: " + _Camera.LookAt, new Vector2(0, 0), Color.White); spriteBatch.End(); GraphicsDevice.RenderState.DepthBufferEnable = true; ....... [/CODE] First of all i write some text to the screen. After that i reenable the DepthBuffer but all i get is an black screen with some errors when moving around... any suggestions? greetings :) quibb EDIT: looks like this: http://img215.imageshack.us/img215/788/zbufferproblejx3.jpg

Share this post


Link to post
Share on other sites
oh man.

graphics.GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1.0f, 0);

it's just to late :P
thx anyway!

greetings :)
quibb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this