//Setup the constant buffer.
m_matrices.m_world.identity();
core::Vector3 Eye(5.0f, 1.0f, -15.0f);
core::Vector3 At(0.0f, 0.0f, 0.0f);
core::Vector3 Up(0.0f, 1.0f, 0.0f);
m_matrices.m_view.buildViewMatrixLH(Eye, At, Up);
m_matrices.m_projection.buildProjectionMatrixLH(XM_PIDIV2, window->getScreenSize().width/window->getScreenSize().height, 0.1f, 100.0f);
D3D11_BUFFER_DESC bd;
ZeroMemory( &bd, sizeof(bd) );
bd.Usage = D3D11_USAGE_DEFAULT;
bd.ByteWidth = sizeof(SMatrixBuffer);
bd.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
bd.CPUAccessFlags = 0;
if( FAILED(m_d3dDevice->CreateBuffer( &bd, NULL, &m_constantBuffer ) ) )
core::DebugUtils::out << "Error: Failed to create constant buffer.\n";
setTransform(m_matrices.m_world, m_matrices.m_view, m_matrices.m_projection);
setTransform just looks like this:
world.getTransposed(m_matrices.m_world);
view.getTransposed(m_matrices.m_view);
projection.getTransposed(m_matrices.m_projection);
m_deviceContext->UpdateSubresource(m_constantBuffer, 0, NULL, &m_matrices, 0, 0);
m_deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
And then I draw everything like normal. The problem is, I get only a blank blue screen. I know that the matrices must be correct though. I can see the vertices correctly transformed and position in PIX in the "post VS" section. They just don't show up in the viewport at all. Here's my vertex shader:
PSInput output;
output.Pos = mul( input.Pos, World );
output.Pos = mul( output.Pos, View );
output.Pos = mul( output.Pos, Projection );
//output.Pos = input.Pos;
output.Texcoord = input.Texcoord;
return output;