title: DirectX11 wireframe z-fighting help (or why D3D11_RASTERIZER_DESC.DepthBias is an INT?)
body: <p>I'm trying to use the <code>DepthBias</code> property on the rasterizer state in DirectX 11 (<code>D3D11_RASTERIZER_DESC</code>) to help with the z-fighting that occurs when I render in wireframe mode over solid polygons (wireframe overlay), and it seems setting it to any value doesn't change anything to the result. But I noticed something strange... the value is defined as a <code>INT</code> rather than a <code>FLOAT</code>. That doesn't make sense to me, but it still doesn't happen to work as expected. How do we properly set that value if it is a <code>INT</code> that needs to be interpreted as a <code>UNORM</code> in the shader pipeline?</p>
  
  <p>Here's what I do:</p>
  
  <ol>
  <li>Render all geometry</li>
  <li>Set the rasterizer to render in wireframe</li>
  <li>Render all geometry again</li>
  </ol>
  
  <p>I can clearly see the wireframe overlay, but the z-fighting is horrible. I tried to set the <code>DepthBias</code> to a lot of different values, such as <code>0.000001</code>, <code>0.1</code>, <code>1</code>, <code>10</code>, <code>1000</code> and all the minus equivalent, still no results... obviously, I'm aware when casting the float as integer, all the decimals get cut... meh?</p>
  
  <pre><code>D3D11_RASTERIZER_DESC RasterizerDesc;
  ZeroMemory(&amp;RasterizerDesc, sizeof(RasterizerDesc));
  RasterizerDesc.FillMode = D3D11_FILL_WIREFRAME;
  RasterizerDesc.CullMode = D3D11_CULL_BACK;
  RasterizerDesc.FrontCounterClockwise = FALSE;
  RasterizerDesc.DepthBias = ???
  RasterizerDesc.SlopeScaledDepthBias = 0.0f;
  RasterizerDesc.DepthBiasClamp = 0.0f;
  RasterizerDesc.DepthClipEnable = TRUE;
  RasterizerDesc.ScissorEnable = FALSE;
  RasterizerDesc.MultisampleEnable = FALSE;
  RasterizerDesc.AntialiasedLineEnable = FALSE;
  </code></pre>
  
  <p>As anyone figured out how to set the <code>DepthBias</code> properly? Or perhaps it is a bug in DirectX (which I doubt) or again maybe there's a better way to achieve this than using <code>DepthBias</code>?</p>
  
  <p>Thank you!</p>