6

I would like to apply a shader effect to an image in c#/xaml.

I have found this example:

http://msdn.microsoft.com/en-us/library/system.windows.media.effects.shadereffect(v=vs.95).aspx

Which makes applying pixel shaders to an image pretty trivial. Unfortunately I cannot do the same thing with the windows 8 phone SDK.

Can I do anything this simple? I would like to avoid using DirectX if possible.

Styxxy
  • 7,462
  • 3
  • 40
  • 45
Toadums
  • 2,772
  • 8
  • 44
  • 67

2 Answers2

1

Check the link below:

Creating a Lens Application that uses HLSL effects for filters

This solution uses SharpDX api (a C# DirectX wrapper).

I've tested recently and it works fine under emulator.

Unfortunally I didn't get the same results when applying outside a Game class. I already published a question here with no responses yet. :-(

Good luck!

Best regards,

Pieter Voloshyn

Pieter Voloshyn
  • 196
  • 1
  • 7
0

Unfortunately you cannot make custom ShaderEffects in Windows Phone 7 or 8. See also: WP7 - HLSL effects from WPF/Silverlight

Also it would appear that XNA is a no-go: Windows Phone custom shaders error? I don't think XNA has had any feature additions from WP7 to WP8, either.

You might be able to get away with doing what you need in Direct3D: (http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714072(v=vs.105).aspx)

Good luck!

Community
  • 1
  • 1
Gary Johnson
  • 885
  • 7
  • 11
  • FWIW custom shaders are available to native WP8 apps ... and MonoGame apps. – lzcd Feb 27 '13 at 03:29
  • @lzcd can you provide a link or cite? I believe that you must be thinking of DirectX shaders. As far as I know WP8 still does not support custom effects on Framework elements. – McGarnagle Oct 11 '14 at 00:20