Hot answers tagged

2

You can not Sample a texture in vertex shader with regular sampling. You should use SampleLevel and sample a specific mip level of the texture with it. This is because you don't have screen space derivatives (ddx and ddy) in the vertex shader. In the pixel shader those are used to determine the mip level. You can also use texture.Load.


2

It turns out that this is due to optimisation of the .fx compiler. When only one sampler is actually used (regardless of the number of samplers being declared) the effect is compiled to be optimized to only read from the first register. So: With this declaration: sampler ScreenTextureSampler: register (s0) // This is the texture that SpriteBatch will try ...


2

There are two ways to set the stencil buffer value in Direct3D 11, one of which is only available in Direct3D 11.3 (and Direct3D 12). I will split this answer into two parts accordingly. Direct3D 11 General As part of the D3D11_DEPTH_STENCIL_DESC you specify what action to take on a stencil test pass and fail. These options boil down to: Keep the current ...



Only top voted, non community-wiki answers of a minimum length are eligible