0

Pretty basic: If I draw two polygons (lines in appearance, but they're triangulated quads for the lines) with 0.2f in the Alpha, I'd like them to be brighter where they overlap.

Currently, no matter what blending op I've tried, the results vary but I can't get that one. I've confirmed they're both drawing with 0.2f, I'd just expect that where they overlap they'd get "brighter"

Here are the two I thought should do something similar, but to no avail. I know the blendstate is being respected (it's different results if I change the ops) but I'm missing another setting or have the wrong src/dst/ops here.

const static struct D3D11_RENDER_TARGET_BLEND_DESC BlendAlpha =
{
    /* BlendEnable              */ TRUE,
    /* SrcBlend                 */ D3D11_BLEND_SRC_ALPHA,
    /* DestBlend                */ D3D11_BLEND_INV_SRC_ALPHA,
    /* BlendOp                  */ D3D11_BLEND_OP_ADD,
    /* SrcBlendAlpha            */ D3D11_BLEND_ONE,
    /* DestBlendAlpha           */ D3D11_BLEND_ONE,
    /* BlendOpAlpha             */ D3D11_BLEND_OP_ADD,
    /* RenderTargetWriteMask    */ D3D11_COLOR_WRITE_ENABLE_ALL
};

or

const static struct D3D11_RENDER_TARGET_BLEND_DESC BlendAlphaAdditive =
{
    /* BlendEnable              */ TRUE,
    /* SrcBlend                 */ D3D11_BLEND_SRC_ALPHA,
    /* DestBlend                */ D3D11_BLEND_ONE,
    /* BlendOp                  */ D3D11_BLEND_OP_ADD,
    /* SrcBlendAlpha            */ D3D11_BLEND_ONE,
    /* DestBlendAlpha           */ D3D11_BLEND_ONE,
    /* BlendOpAlpha             */ D3D11_BLEND_OP_ADD,
    /* RenderTargetWriteMask    */ D3D11_COLOR_WRITE_ENABLE_ALL
};

But the result is not what I want:

enter image description here

Dave
  • 1,521
  • 17
  • 31

1 Answers1

1

Turns out the depth stencil was preventing the top pixels from even drawing to the back buffer; once I disabled the depth stencil I was able to proceed.

halfer
  • 19,824
  • 17
  • 99
  • 186
Dave
  • 1,521
  • 17
  • 31