1
我正在学习DirectX SDK中的阴影贴图示例。这个样品在初始化期间创建了一个模板表面,并且说:默认情况下创建的深度模板缓冲区导致的问题
Create the depth-stencil buffer to be used with the shadow map
We do this to ensure that the depth-stencil buffer is large
enough and has correct multisample type/quality when rendering
the shadow map. The default depth-stencil buffer created during
device creation will not be large enough if the user resizes the
window to a very small size. Furthermore, if the device is created
with multisampling, the default depth-stencil buffer will not
work with the shadow map texture because texture render targets
do not support multisample.
这是什么意思?我试图评论在模板缓冲区创建和操作的语句,然后我得到了非常不稳定的结果:如果我使窗口更大,阴影运行良好,而当窗口变得更小时阴影停止移动。 有没有人可以向我解释这个?非常感谢你!!!
感谢了很多,但我仍然有问题的技术。首先,为什么我应该在阴影贴图中使用模板缓冲区,如果我的目标只是将顶点着色器的Z/W比率传递给像素着色器?接下来是,默认的模板缓冲区是否真的不支持阴影贴图?为什么?仅仅因为多重采样? – user2310794 2013-04-25 01:20:47
我在回答中添加了一些更多信息,如果您接受它,会很好。 – 2013-04-25 10:52:05