0
\$\begingroup\$

I did some blending and culling to get the image below.

Image of three electric rings

As you can see, it is messed up. On the right side of the image, only the front side of the mesh shows. On the left side of this image, it works, you can see both the front and back sides.

I'm pretty sure it is the culling. Here are my settings for blending and culling:

opaquePsoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
opaquePsoDesc.RasterizerState.CullMode = D3D12_CULL_MODE_NONE;

AND blending

D3D12_GRAPHICS_PIPELINE_STATE_DESC blendPsoDesc = opaquePsoDesc;

    D3D12_RENDER_TARGET_BLEND_DESC blendDesc;
    blendDesc.BlendEnable = true;
    blendDesc.LogicOpEnable = false;
    blendDesc.SrcBlend = D3D12_BLEND_ONE;
    blendDesc.DestBlend = D3D12_BLEND_ONE;
    blendDesc.BlendOp = D3D12_BLEND_OP_ADD;
    blendDesc.SrcBlendAlpha = D3D12_BLEND_ZERO;
    blendDesc.DestBlendAlpha = D3D12_BLEND_ZERO;
    blendDesc.BlendOpAlpha = D3D12_BLEND_OP_ADD;
    blendDesc.LogicOp = D3D12_LOGIC_OP_NOOP;
    blendDesc.RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL;

    blendPsoDesc.BlendState.RenderTarget[0] = blendDesc;
    ThrowIfFailed(md3dDevice->CreateGraphicsPipelineState(&blendPsoDesc, IID_PPV_ARGS(&mBlendPSO)));

What am I doing wrong?

\$\endgroup\$
  • \$\begingroup\$ Can you show us where you set your depth write / depth test settings? This looks like a depth issue, not a culling or blending issue. \$\endgroup\$ – DMGregory Aug 17 '19 at 10:11
  • \$\begingroup\$ Not familiar with Direct3D, but with OpenGL this is usually caused by depth-testing and rendering faces in an unsorted order. The back faces don't render because there's something in front of them (that's what depth testing does) unless you happen to render the back faces first by chance. \$\endgroup\$ – user253751 Aug 21 '19 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.