Tag Info

New answers tagged

0

D3D11 will prevent you from binding a shader view of a resource and a render view of a resource simultaneously. Consequently you will need to bind and unbind the views every time you want to read or write to the depth texture; you can't just bind them and leave them that way for the lifetime of your program, because you can't have both views bound ...


0

Change depthStencilDesc.DepthFunc = D3D11_COMPARISON_LESS; to depthStencilDesc.DepthFunc = D3D11_COMPARISON_ALWAYS;


1

Ideally you should have no warnings, but depending on your application you may find a number of warnings tolerable or even desirable. In that case, you might consider suppressing the particular warning so you don't end up with noise in the output causing you to miss other warnings. See Direct3D SDK Debug Layer Tricks for how to do this. Note that you ...


0

As described here, the texture wasn't bound to the Vertex shader. Without this (@Mooseboys) The texture data was not presented to the Vertex Shader, causing NULL or zero values. Binding the texture resolved the problem.


1

PSGetShader (and in general, all state getters in D3D) are not intended to be called at high frequency. You should do dirty state tracking, and you should implement it yourself. Using PSGetShader will at a minimum create the additional overhead of the AddRef which you don't need for dirty state tracking.


0

Dispatch a message every time you have to change render state and add a corresponding handler. This way you do not have a check in every frame / game step, but it is rather handled like a click would be, it is recognized when in the message queue and handled correspondingly.


0

Fix your matWorldViewProj. w values are NaN, so the transformation will fail miserably. The w column should be (0,0,0,1). Also, you should be getting complaints at the following line: Output.Position = mul(Input.Position, matWorldViewProj); as you multiply a 4x4 matrix with a float3. Change it to: Output.Position = mul(float4(Input.Position,1), ...


2

COLOR0 is DX9. Since you're dealing with DX11 (ps_5_0) you need to replace COLOR0 with SV_Target.


0

The problem is that L.Direction vector is not normalized, so the dot product "max(dot(v, toEye)" is calculating |v|*cos Θ instead of cos Θ, which is not what we want. So normalizing it on CPU side solves the problem. Thank you @snake5 for helping me on chat with it.


0

Fundamentally, if you want objects that are in a hierarchy relative to a parent, you need to do a concatenation of the local-to-parent transform with the parent. This is how it works. I see now way around it, and I wouldn't describe it as 'visual tricks' - that's how a transform hierarchy works. Objects have orientations and positions in world space, but if ...


0

I think I have fixed it. I am using DirectX Tool Kit as well, and now that I got the graphics debugger to work, I noticed that the depth testing was being disabled. I can only assume it is a result of using SpriteBatch to render text and other 2D components. So simply setting the depthStencilState at the begining of my render function, it fixed it.



Top 50 recent answers are included