This function should be redesigned to be e.g. taking lambda or programmable 😆...
Preword
To understand blend func or op in graphics API, the best place to go is this website.
Blend Color
I think these things should be move into the effect file.
RenderTargetBlend(SetRenderState)
resultcolor = ((Srcblend)*Scrcolor) BlendOp ((Destblend)*Destcolor)
alphacolor = (SrcblendAlpha*Scralpha) AlphaOp (DestblendAlpha*Destalpha)
Carefully design your render parameter, you can set a constant blend factor. When D3DRS_SEPARATEALPHABLENDENABLE is set to FALSE (which is the default condition), the render target blending factors and operations applied to alpha are the same as those defined for blending color channels. Be sure to enable D3DRS_ALPHABLEND to tell the pipeline that alpha blending is needed.
TextureBlend(SetTextureStageState)
resultofStage = BlendOp(colorarg1,colorarg2,…..)
resultalphaofStage = AlphaBlendOp(alphaarg1,alphaarg2,…..)
Notice that if you don’t care about your vertex color when using texture in Fixed Function, dx will give you a random results.