Dark particles almost disappear in game

Started by
1 comment, last by mikiex 10 years, 11 months ago

Hey

I’m having this problem with transparency on particles that I can’t really get my head around. It appears that bright alpha blended particles show up much more pronounced in game than dark ones. I hacked the pixel shader so that I could toggle the output RGB from darkest (0.0f) to brightest (1.0f), with alpha value identical. I would have expect both to contribute approximately the same, maybe appear a little different dependent on the background but as you can see the dark particles almost disappear:

alpha_blending_dark-1.jpgalpha_blending_bright.jpg

Does anybody know why this might be happening? The platform I'm running on is PC, Directx11. I took a look in some profiling tools the black smoke are written to the colour buffer with the format DXGI_FORMAT_R16G16B16A16_FLOAT. The blend settings are:

RenderTarget[0]

BlendEnable 1

SrcBlend D3D11_BLEND_SRC_ALPHA

DestBlend D3D11_BLEND_INV_SRC_ALPHA

BlendOp D3D11_BLEND_OP_ADD

SrcBlendAlpha D3D11_BLEND_SRC_ALPHA

DestBlendAlpha D3D11_BLEND_INV_SRC_ALPHA

BlendOpAlpha D3D11_BLEND_OP_ADD

RenderTargetWriteMask D3D11_COLOR_WRITE_ENABLE_ALL

I tried with a few different blend settings with no improvement. I tried pre-multiplied alpha as well. Each particle is setup to have a small alpha value if I crank it up the dark particles appear more but that makes the bright particles over-saturated. I need to have dynamically both bright and dark particles from the same emitter as I'm applying lighting to the particles. Has anybody come across this problem before?

Thanks,

Simon

Advertisement

Blend state looks fine. The dark smoke in the left picture should be just as visible as white smoke on the right.

Are you sure you're setting the RGB values to zero and not the alpha value? What happens when you try writing out different colors?

Each particle is setup to have a small alpha value if I crank it up the dark particles appear

Is this an additional alpha value next to what's stored in the texture?

Well there is no reason to be blending the targets alpha SrcBlendAlpha DestBlendAlpha ?

I'm not saying thats the problem though, but thought I would point it out.

These are normally set to one or zero.

This topic is closed to new replies.

Advertisement