Search code examples
c++directxhlsl

DirectX 11 Rendering Object Inside out


I am having alot of struggles trying to follow Frank Luna's book for DirectX 11 3D Programming, and I am currently up to chapter 7 section 2. I have imported the Skull model file and I have begun to render it. The strange thing is that when I am rendering it, it appears to be rendering the back faces over the front facing faces. I am pretty sure this is the case of what is happening. But I am putting forth this question for help and guidance on where I may be going wrong. I will edit this post with inclusions of my code if required to help me figure out where I am going wrong, Thanks alot! (photo's attached)

Photo - Facing the Skull, Slightly to the Left

Photo - Above the Skull, Facing Downwards

EDIT: I have set a breakpoint in my code for after the first draw call loop and it does not show any faces which are behind the fronts ones, so issue is solved at this frame, but when I continue to the next frame, this is when the problems start.


Solution

  • I figured out what had been causing my grief. I have been using DirectXToolKits SpriteFont and SpriteBatch class's to use the function DrawString to display an FPS counter at the top left corner of the screen, and it must have been messing around with the ID3D11DeviceContext::DrawIndexed calls. Thankyou for all your input and brainstorming!!