BlendState Problem

Started by
1 comment, last by hossainiir 11 years, 4 months ago
hi,
i have a problem with BlendState, before insert the following codes everything works fine in my app but after setting codes everything in my rendering panel disapear.
i test the app with PIX after inserting the codes, ShaderResources,VertexBuffers,IndexBuffers and every thing was ok!!!!

var des = new BlendStateDescription {IndependentBlendEnable = false};
Context.OutputMerger.BlendState = BlendState.FromDescription(Device,des);          
why??? sad.png

???? ?? ??? ????

Persian Gulf

Advertisement
Can you please include the description.

Edit : Oh, that is your description.

Edit2 : What happens if you provide this blend description ..


// blend supporting transparency
BlendStateDescription bsd1 = new BlendStateDescription()
{
IndependentBlendEnable = false,
AlphaToCoverageEnable = false,
};
bsd1.RenderTargets[0] = new RenderTargetBlendDescription();
bsd1.RenderTargets[0].BlendEnable = true;
bsd1.RenderTargets[0].RenderTargetWriteMask = ColorWriteMaskFlags.All;

bsd1.RenderTargets[0].SourceBlend = BlendOption.SourceAlpha;
bsd1.RenderTargets[0].BlendOperation = BlendOperation.Add;
bsd1.RenderTargets[0].DestinationBlend = BlendOption.InverseSourceAlpha;

bsd1.RenderTargets[0].SourceBlendAlpha = BlendOption.One;
bsd1.RenderTargets[0].BlendOperationAlpha = BlendOperation.Add;
bsd1.RenderTargets[0].DestinationBlendAlpha = BlendOption.One;

BlendState_Transparent = BlendState.FromDescription(Device11, bsd1);
BlendState_Transparent.DebugName = "BlendState_Transparent";
Tnx Gavin Williams.
your code works fine.

???? ?? ??? ????

Persian Gulf

This topic is closed to new replies.

Advertisement