【发布时间】:2011-10-16 15:51:07
【问题描述】:
我正在绘制几个模型,使用以下代码设置渲染状态:
GraphicsDevice.BlendState = BlendState.Opaque;
GraphicsDevice.DepthStencilState = DepthStencilState.Default;
GraphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;
GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;
某些模型渲染不正确。如果我更改一行代码:
GraphicsDevice.DepthStencilState = DepthStencilState.DepthRead;
现在,其他人无法正常工作。我对每个代码段使用了 2 个代码,但它仍然不起作用。
如何解决这个渲染问题?
截图:
我先画地面,然后是“道路”模型。
顶部:http://i.stack.imgur.com/xH8qp.png
当我改变相机的角度时...:http://i.stack.imgur.com/Nbw3m.png
【问题讨论】:
-
好的,我刚刚编辑了我的帖子。
标签: c# graphics xna 3d xna-4.0