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