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

Topics I've Started

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

06 November 2012 - 05:08 PM

I'm using SharpDX on the Windows Phone 8 and therefore although it uses DirectX11 it is feature level 9_3. This means certain things won't work on the device but will work on the emulator. I have a shader working on the emulator that uses alpha blending but I can't get it working on the phone at all. Basically I am drawing to a render target without clearing it and then drawing that to another one and multiplying the alpha by 0.95 to slowly fade it out over time. On the emulator this creates a nice fading trail behind a moving object. On the phone however the trail is just always the same colour and doesn't fade.

I am assuming this has something to do with feature level 9_3 but I can't figure out what it is I am doing that is wrong.

Here's the pixel shader:

[source lang="cpp"]Texture2D<float4> shaderTexture : register(t0);sampler TextureSampler =sampler_state{ Texture = <shaderTexture>; MipFilter = LINEAR; MinFilter = LINEAR; MagFilter = LINEAR; AddressU = Mirror; AddressV = Mirror;};struct PSInput{ float4 ScreenPosition : SV_POSITION; float2 UV : TEXCOORD;};float4 main( PSInput input ) : SV_TARGET{ float4 textureColor = shaderTexture.Sample(TextureSampler, input.UV); textureColor.a *= 0.95f; return textureColor;}[/source]

Thanks for any suggestions.