Tag Info

New answers tagged

1

It basically doesn't matter. #define uses token-pasting to insert the specified value into the shader code whereever it occurs; the shader itself will see the token as if you simply hard-coded it at every occurrence instead. A static const variable in, in actuality, a variable. Specifically, it is a variable that is initialized once, whose value persists ...


0

Your problem is the difference between XMMatrixLookToLH and XMMatrixLookAtLH. The DirectX TK SimpleSample is using XMMatrixLookAtLH which is computing: XMVECTOR Eye = XMVectorSet(0.0f, 3.0f, -6.0f, 0.0f); XMVECTOR At = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMVECTOR Up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMMATRIX g_View = XMMatrixLookAtLH(Eye, At, Up); ...


0

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


2

The official Visual Studio "DirectX" templates are only for Windows Store apps for Windows 8.x and Windows phone 8.x. They do not support Win32 desktop apps. In order to develop Windows Store apps for Windows 8.1 or Windows phone 8.1 apps, you need: VS 2013 (any edition except Express for Web and Express for Windows Desktop) A Windows 8.1 system In ...


1

The issue seem to be that you don't copy data over, you're overwriting the idata pointer with the address of mIV: idata = mIV; // this changes idata to point to mIV, not copy data Should be something like: for(size_t i=0; i < (sizeof(mIV) / sizeof(mIV[0])); ++i){ idata[i] = mIV[i]; } Or memcpy(idata, mIV, sizeof(mIV)); Or some other copy ...


0

I got my answer: The mat4 simply applies a rotation to the vec3, and that rotation information is stored only in the 3x3 part of that mat4, so i can safely cast the mat4 to a mat3 and multiply with the vec3 to get things going, something like m_look = mat3(rotation)*m_look; That would give me what i wanted. I can then normalize my vec3.


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

The quaternion you find using your method is indeed correct. However, it’s also pretty unlikely that DirectX::XMQuaternionSlerp would behave incorrectly with such trivial input. Thus, I suspect that the thing you are doing wrong is: trusting what you see in the debugger while running potentially optimised code assuming the layout of a __mm128 would be ...


2

By design, DirectXMath returns for XMQuaternionSlerp the same result as you'd get from the following (inefficient used only for testing) scalar code: XMVECTOR ScalarQuatSlerp(XMVECTOR q1, XMVECTOR q2, float t) { // Extract the components float q1x = XMVectorGetX(q1); float q1y = XMVectorGetY(q1); float q1z = XMVectorGetZ(q1); float q1w = ...


2

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


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