Can a 2D image intersect a 3D model?

Yes it can 🙂

My may sample is also my first public sample written in XNA Game Studio 3.0 CTP, and it shows how to restore the depth buffer from a depth texture.

This way, models drawn to a render target, with post processing applied to them can intersect and obscure normal models, drawn after all the post processing is done.

For more details, jump to the sample’s page: Restoring the Depth Buffer, where you can find a short explanation on how the sample works.

To dive right into the code, download it here. Please note that the sample is written in XNA Game Studio 3.0 CTP, but the technique also works just fine in 2.0.

DepthRecovery 2008-05-19 02-30-51-86

Categorized: HLSL, XNA

Comments are closed.