   [MDX] Render Target depth buffer
  Whenever I set the render target to a surface that I have created any geometry drawn to this target isn't added or compared to the depth buffer. Anything that is drawn to this target is drawn over everything. I don't want to set a new depthbuffer, I want to use the current(default) depth buffer. And my renderTarget is created with the same depth format as in the PresentParams.Here's what I do://...save the d3d render target...//set to a different RTgDevice.SetRenderTarget(0, mRTSurface);...draw some geometry....//...reset the device RT to the original...How can I get this to draw correctly? It's really driving me crazy why this renderTarget doesn't use the depth buffer.[Edited by - glaeken on September 8, 2007 9:27:01 PM]
  Standard questions apply:- debug runtime selected?- no relevant messages in the debug output?- works the same on REF?;  Works the same with debug/retail runtimes. I'm using mdx, and I've never got a meaningful debug output with an error(just says the dll error occurred) or other wise. But it doesn't error out though anyways. Just tested it with the reference rasterizer and it draws correctly. What exactly does this mean?   ;  For mdx, you need to enable "unmanaged debugging" in your project in order to see the debug runtime messages.  Alternately, you can run dbmon, or any other debug output stream logger concurrently with your application.For reference, working the same on debug/retail runtimes really doesn't tell you anything since this is just comparing "heavy parameter checking" (debug)to "no parameter checking" (retail).Working properly REF and not on HAL could mean a driver bug, or it could mean that there's a CAP you didn't check.  REF tends to expose all features and set all relevant CAPS, while HAL may not support some features you assumed and not set the appropriate CAPS bits.Try running it again and examining the debug output and see if there are any messages.   ;  I had been setting multisampling in the presentParams, and it gave an error indicating incompatible MultiSampleType between the DepthStencil and my RenderTarget.  Is there anyway to enable anti-aliasing on a Texture? After a quick google, it seems that there isn't besides using a shader.[Edited by - glaeken on September 9, 2007 11:07:47 AM];  Create a mult-sampled render target, render to that target, and then StretchRect from the multi-sampled render target to the texture level surface.   ;  Ah, thanks. Such a simple solution, I feel dumb now.   