Exemplo n.º 1
0
		public void AlphaBlendStateIsValid()
		{
			// Arrange.
			var device = new Device();
			var blendState = new BlendState(device, BlendStateDescription.AlphaBlend);
		    var source = new Number4(1.0f, 0.0f, 0.0f, 0.3f);
		    var destination = new Number4(0.0f, 1.0f, 0.0f, 0.4f);
		    var blendFactor = new Number4();

			// Act.
			var result = blendState.DoBlend(0,
                ref source, ref destination,
                ref blendFactor);

			// Assert.
			Assert.That(result.R, Is.EqualTo(1.0f).Within(0.01f));
			Assert.That(result.G, Is.EqualTo(0.7f).Within(0.01f));
			Assert.That(result.B, Is.EqualTo(0.0f).Within(0.01f));
			Assert.That(result.A, Is.EqualTo(0.3f + (1 - 0.3f) * 0.4f).Within(0.01f));
		}
Exemplo n.º 2
0
 public BlendStateViewModel(BlendState blendState)
 {
     _blendState = blendState;
 }
Exemplo n.º 3
0
		public OutputMergerStage(Device device)
		{
			DepthStencilState = new DepthStencilState(device, DepthStencilStateDescription.Default);
			BlendState = new BlendState(device, BlendStateDescription.Default);
		}
Exemplo n.º 4
0
 public OutputMergerStage(Device device)
 {
     DepthStencilState = new DepthStencilState(device, DepthStencilStateDescription.Default);
     BlendState        = new BlendState(device, BlendStateDescription.Default);
 }