I've been learning basic 3D engine programming and finally got to a stage where I have a very simple engine running, displaying a bunch of spinning rainbow cubes. I had built a similar demo a little while ago, but this is the first time the code has been properly integrated into some semblance of an engine, with different areas properly segregated and so forth.
I'm experiencing a weird issue where I have to set CullMode.Front by default, or all of the back faces render, while the front faces are ignored. Obviously this is backwards to what should actually by happening but I'm having trouble figuring out why. Any suggestions would be appreciated.
Then you have found your own problem it would seem.
The D3D11_RASTERIZER_DESC::FrontCounterClockwise member defaults to FALSE.
L. Spiro
Ah thanks! I'm assuming counterclockwise is the standard most engines use? I'm confused why the default settings for the rasterizer description put the winding direction at odds with cull mode...
It’s not. First you define which direction defines a front face (clockwise or counter clockwise) and then you decide whether you want to cull front faces or back faces. I personally use clockwise, but whether one is used more than the other or by whom one is used is rather arbitrary—there is no reason to pick one over the other except that that is how your toolchain works.
L. Spiro
I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid
It’s not. First you define which direction defines a front face (clockwise or counter clockwise) and then you decide whether you want to cull front faces or back faces. I personally use clockwise, but whether one is used more than the other or by whom one is used is rather arbitrary—there is no reason to pick one over the other except that that is how your toolchain works.
L. Spiro
Ah, thanks, that's helpful. I wonder if it's a bug in SharpDX for configuring the Rasterizer.Default() method to have the winding order mismatched with the cull mode.