Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Nov 2012
Offline Last Active Nov 13 2012 06:42 PM

Posts I've Made

In Topic: Alpha Blending with SharpDX/DirectX11/WP8 using feature level 9_3

06 November 2012 - 11:01 PM

Ah thanks, yes that is annoying about not having default values for structs.

This didn't change the alpha blending on the device unfortunately, it is still either off or on. If you multiply in the shader by anything below 0.5f it is off and anything above it is on, it isn't blending at all. I also changed the blendStateDesc to use BlendStateDescription.Default() but that didn't change anything.

Yes I realise I should have started fresh with the Toolkit but I had already started the code in XNA and then C++ so this project has been moved about a lot. All just for 2D rendering, it's pretty frustrating. Next time I will definitely use Toolkit, it looks a lot more like XNA, which is nice.

In Topic: Alpha Blending with SharpDX/DirectX11/WP8 using feature level 9_3

06 November 2012 - 08:57 PM

Hmm maybe that's the problem then. I am really having trouble switching to DX11 and WP8. It seems like finding the right info out there is incredibly hard. All the tutorials are for DX9. Thanks once again for the help Xoofx, you're really saving me here.

I'll edit with an update after I've rewritten it to pass the samplerstate in from code.

Creating a SamplerState causes a SharpDXException for some reason. The device is already set and creating the BlendState works fine:

[source lang="csharp"]var samplerStateDesc = new SamplerStateDescription(); samplerStateDesc.Filter = Filter.MinMagMipLinear; samplerStateDesc.AddressU = TextureAddressMode.Mirror; samplerStateDesc.AddressV = TextureAddressMode.Mirror; samplerStateDesc.ComparisonFunction = Comparison.Never; samplerStateDesc.MinimumLod = 0; samplerStateDesc.MaximumLod = int.MaxValue; _samplerState = new SamplerState(_device, ref samplerStateDesc);[/source]