For my coursework I started working on a small deferred renderer. I am using no optimizations like gbuffer packing, a light pre-pass or so.
The general shader seem to work fine, but when I add a second light, I noticed the blending is not working.
So instead of the spotlight being added the spotlight overdraws everything, so the previously visible arrays of the directional light are black.
My BlendState is defined in the FX file as follows:
BlendState AdditiveBlending
{
BlendEnable[0] = TRUE;
SrcBlend[0] = ONE;
DestBlend[0] = ONE;
BlendOp[0] = ADD;
SrcBlendAlpha[0] = ZERO;
DestBlendAlpha[0] = ZERO;
BlendOpAlpha[0] = ADD;
RenderTargetWriteMask[0] = 0x0F;
};
And Set in the associated technique like this:
SetBlendState(AdditiveBlending, float4(0.0f, 0.0f, 0.0f, 0.0f), 0xffffffff);
I am new to blending and thought I figured it out, unfortunately not...
Thanking you in anticipation,
Nik