Where is my triangle? Issue moving to Directx 11 and Metro

Started by
27 comments, last by AlzPatz 11 years, 5 months ago
Hi AlzPatz.
I received your code, however I currently have no win8 dev environment therefore no chance to compile your code.
The code and the shaders seem fine, but the devil is in the details as usual.

To diagnose my problem I switched the cull mode to D3D11_CULL_NONE so the rasterizer would render everything that should be on screen.
in native c++ it would look somethin like this:
[source]
D3D11_RASTERIZER_DESC rd;
ZeroMemory(&rd, sizeof(rd));
rd.CullMode = D3D11_CULL_NONE;
rd.FrontCounterClockwise = false;
rd.FillMode = D3D11_FILL_SOLID;

device->CreateRasterizerState(&rd, &rasterizerState);
immediateContext->RSSetState(rasterizerState);
[/source]

Also try to disable the depthstencilbuffer as you don't need it anyway when you draw screen coordinates directly, by not setting in the OMSetRenderTargets call:

[source]
//Set the Render Context
d3dContext->OMSetRenderTargets(1, renderTargetView.GetAddressOf(), nullptr)
[/source]

You should also have a look at the DX11 MSDN tutorial (especially No 2), if you have not already.
http://code.msdn.mic...979ef?SRC=VSIDE

I hoped I could be more helpful.

Let me know if that brought you forward.

C.
Advertisement
Thanks, I had look at the disabling the depth stencil before and did play with a different rasterizer (the code i sent did not set one, just use default)(. but will retry. thanks for looking anyway! ill report back
Is anyone willing to receive a C++ Metro App to run, either with diagnostics or just to have a browse and see what simple mistake i am making?
by that i mean the zipped solution
OK - I have this weekend spare for programming and don't want to spend it stuck on this issue. I have solution ready to send. It is a Metro App.
$0
Hi, some links to the visual studio solutions.

The Metro Version that doesn't work..(shader code is compiled by VS2012's nice new abilitie, you need Win8 and VS2012)
http://www.filedropper.com/metrodx11trianglenotviewable

The Win32 Version that does work... (same shader code. uses shader compilation at run time)
http://www.filedropper.com/win32dx11triangleisviewable

As you can see, win 32..easy! Metro...no triangles :(
I'm sorry that I keep bumping this thread. Is there anyone with a Windows 8 Development Environment and Visual Studio 2012 Professional that can run this through the graphics debugger to find out what is going wrong? I've rewritten this a million times now. Going stir crazy as not sure where the problem lies..think must be shader, but are so simple. THANKS
SOLVED...After so much time it was such a silly mistake (as always). I messed up the vertex buffer setting. d3dContext->IASetVertexBuffers(0, 1, &vertexBuffer, &str, &oset); had to be : d3dContext->IASetVertexBuffers(0, 1, vertexBuffer.GetAddressOf(), &str, &oset);

This topic is closed to new replies.

Advertisement