Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualmagicstix

Posted 03 December 2012 - 05:42 PM

This might actually be a precision problem. Are you using low-color-resolution rendertargets/backbuffer/textures (8 bit per channel) ?


I'm using 32-bit color for the backbuffer (R8G8B8A8) but 32 bit float for the texture render target. I didn't know your backbuffer could go higher than 32bit (8 bit per channel) color... When I try R32G32B32A32_FLOAT for the back buffer I get a failure in trying to set up the swap chain.

Maybe I need to accumulate in a second texture render target instead of the back buffer?


-- Edit --

I forgot to mention I've changed my blending a bit. I'm using a blend factor now instead of straight alpha blend, but I'm still having the same effect with not getting it to fade completely to zero.

Here are my current settings:
rtbd.BlendEnable    = true;
rtbd.SrcBlend	 = D3D11_BLEND_SRC_COLOR;
rtbd.DestBlend	 = D3D11_BLEND_BLEND_FACTOR;
rtbd.BlendOp	 = D3D11_BLEND_OP_ADD;
rtbd.SrcBlendAlpha    = D3D11_BLEND_ONE;
rtbd.DestBlendAlpha    = D3D11_BLEND_ONE;
rtbd.BlendOpAlpha    = D3D11_BLEND_OP_ADD;
rtbd.RenderTargetWriteMask  = D3D11_COLOR_WRITE_ENABLE_ALL;

/* .... */
float blendFactors[] = {.99, .97, .9, 0};
g_pImmediateContext->OMSetBlendState(g_pTexBlendState, blendFactors, 0xFFFFFFFF);

If I understand this correctly, it should eventually fade to completely black, since the blend factor will make it slightly darker every frame, yet I'm still left with the not-quite-black trail.

#1magicstix

Posted 03 December 2012 - 05:22 PM

This might actually be a precision problem. Are you using low-color-resolution rendertargets/backbuffer/textures (8 bit per channel) ?


I'm using 32-bit color for the backbuffer (R8G8B8A8) but 32 bit float for the texture render target. I didn't know your backbuffer could go higher than 32bit (8 bit per channel) color... When I try R32G32B32A32_FLOAT for the back buffer I get a failure in trying to set up the swap chain.

Maybe I need to accumulate in a second texture render target instead of the back buffer?

PARTNERS