我在GraphicsDevice
类的成员中没有看到RenderState
,这个类曾经用于禁用深度缓冲区。有人知道如何在新的4.0 API中实现吗?
如果能够访问完整的像RenderState
一样的类就太好了。虽然GraphicsDevice
似乎已经包含了部分功能,但还远远不够!
我在GraphicsDevice
类的成员中没有看到RenderState
,这个类曾经用于禁用深度缓冲区。有人知道如何在新的4.0 API中实现吗?
如果能够访问完整的像RenderState
一样的类就太好了。虽然GraphicsDevice
似乎已经包含了部分功能,但还远远不够!
啊..我需要设置GraphicsDevice.DepthStencilState
为一个实例,其中任意数量的属性已被设置。好像RenderState
被分解成了一堆其他状态。我之前在GraphicsDevice
里找这些单独的属性,但现在它们似乎更好地组织在一起,方便管理状态。
depthState = new DepthStencilState();
depthState.DepthBufferEnable = true; /* Enable the depth buffer */
depthState.DepthBufferWriteEnable = true; /* When drawing to the screen, write to the depth buffer */
GraphicsDevice.DepthStencilState = depthState;