nikhilhs Posted April 12, 2004 Posted April 12, 2004 I've used the following lines of code, and passed presentParams into the device constructor. presentParams.Windowed = true; presentParams.SwapEffect = SwapEffect.Discard; presentParams.EnableAutoDepthStencil = true; presentParams.AutoDepthStencilFormat = DepthFormat.D16; However, this does not put the closest stuff in front. I think it's placing the ones that are rendered last in front. What am I doing wrong? Thanks. -Nick Quote
DrunkenHyena Posted April 12, 2004 Posted April 12, 2004 Did you enable the ZBuffer? How are you rendering things? Have you change the Z Comparison render states? Quote
nikhilhs Posted April 13, 2004 Author Posted April 13, 2004 I finally got it to work. Turns out the zNear was set to 0, and z-buffering only works if zNear is a positive value. Quote
DrunkenHyena Posted April 13, 2004 Posted April 13, 2004 If you have the debug runtime set up, it will warn you about things like that. It can save you a lot of hassle. Quote
nikhilhs Posted April 14, 2004 Author Posted April 14, 2004 I have it on debug, but it didn't give me any warnings. Maybe I don't have the thing set up specifically. How do I do that? Quote
DrunkenHyena Posted April 14, 2004 Posted April 14, 2004 I have it on debug' date=' but it didn't give me any warnings. Maybe I don't have the thing set up specifically. How do I do that?[/quote'] If you installed the Debug Runtime then there will be a DirectX icon in the control panel. Run that and go to the Direct3D tab. Set the Debug Level to the second highest setting (The highest setting warns about a LOT of stuff so isn't recommended for regular use). In Visual Studio go to the Project Settings and somewhere in there is a Enable Unmanaged Debugging (or something similar). Set that to true and the debug output will be routed to the Output window. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.