Hi,
I'm wanting to display some geometries using the solidwireframe, it appears to be a fx file with multiple effects and single passes.
technique10 SolidWirePattern
<string info = "SolidWirePattern : SolidWire with a dot line pattern on diagonal edges";>
{
pass
{
SetDepthStencilState( DSSDepthLessEqual, 0 );
SetRasterizerState( RSFill );
SetBlendState( BSBlending, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetGeometryShader( CompileShader( gs_4_0, GSSolidWire() ) );
SetPixelShader( CompileShader( ps_4_0, PSSolidWirePattern() ) );
}
}
can these be converted to HLSL format and called from Directx11.1 like this.
deviceContext->IASetInputLayout(m_vertexLayout);
deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
SetDepthStencilState(deviceContext);
SetRasterizerState(deviceContext);
SetBlendState(deviceContext);
deviceContext->VSSetShader(m_vertexShader, NULL, 0);
deviceContext->GSSetShader(m_geometryShader, NULL, 0);
deviceContext->PSSetShader(m_pixelShader, NULL, 0);
I thought i could do the following for SetDepthStencilState
D3D11_DEPTH_STENCIL_DESC depthStencilDesc;
ZeroMemory(&depthStencilDesc, sizeof(depthStencilDesc));
depthStencilDesc.DepthEnable = true;
depthStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
depthStencilDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
HRESULT result = device->CreateDepthStencilState(&depthStencilDesc, &m_pdepthStencilState);
and SetRasterizerState
D3D11_RASTERIZER_DESC rasterDescription;
ZeroMemory(&rasterDescription, sizeof(D3D11_RASTERIZER_DESC));
rasterDescription.FillMode = D3D11_FILL_SOLID;
rasterDescription.CullMode = D3D11_CULL_NONE;
rasterDescription.DepthBias = 0;
rasterDescription.MultisampleEnable = TRUE;
HRESULT hr = device->CreateRasterizerState(&rasterDescription, &m_prasterState);
and SetBlendState
D3D11_BLEND_DESC blendStateDescription;
ZeroMemory(&blendStateDescription, sizeof(D3D11_BLEND_DESC));
blendStateDescription.RenderTarget[0].BlendEnable = TRUE;
blendStateDescription.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
blendStateDescription.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
blendStateDescription.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
blendStateDescription.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
blendStateDescription.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_DEST_ALPHA;
blendStateDescription.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
blendStateDescription.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
HRESULT result = device->CreateBlendState(&blendStateDescription, &m_pblendingState);
Thanks
Gary