http://www.rastertek.com/dx11tut11.html
以后要写学习笔记了,加深印象。 不过看这个教程很吃力啊。
Don't use dynamic vertex buffers unless they are absolutely called for, they are quite a bit slower than static buffers. Secondly never destroy and recreate a static vertex buffer each frame, this can completely lock the video card (which I have seen on ATI but not on Nvidia) and is far worse in overall performance when compared to using dynamic vertex buffers.
1.在必要的时候才用dynamic vertex buffer
2.static vertex buffer 不要每帧重建、销毁
We are now creating a dynamic vertex buffer so we can modify the data inside the vertex buffer each frame if we need to. To make it dynamic we set Usage to D3D11_USAGE_DYNAMIC and CPUAccessFlags to D3D11_CPU_ACCESS_WRITE in the description.
在dynamic new buffer 之前先进行判断是否需要new buffer。
These are the new functions for enabling and disabling the Z buffer. To turn Z buffering on we set the original depth stencil. To turn Z buffering off we set the new depth stencil that has depthEnable set to false. Generally the best way to use these functions is first do all your 3D rendering, then turn the Z buffer off and do your 2D rendering, and then turn the Z buffer on again.
do all your 3d rendering,then turn the z buffer off and do your 2d rendering ,and then turn the z buffer on again.................