So, i’m trying to make a sort of CCTV in a 3D space for my game, and have already managed to render things to the monitor and assign the texture to a surface. The problem is: For some reason, the depth buffer is disabled once i apply the texture to the monitor’s screen, and i don’t know why. How do i enable it? Is it even possible?
Do you mean that the depth buffer doesn’t work when you set the render target to the device?
Did you create the RenderTarget2D with depth support? The constructor has a DepthFormat parameter.
I did enable the depth buffer in the RenderTarget2D, aswell as in the GraphicsDevice (it’s set to Depth24). What i mean is the depth buffer doesn’t work when i use the RenderTarget2D as a model texture.
You enable and disable the depth buffer by setting GraphicsDevice.DepthStencilState.