So there’s a cool Dx/Cx demo in the consumer preview bits “Direct2D lighting effects sample”. It uses an effect graph to give cool lighting effects to your surfaces.
I wanted to turn that Cx sample into a C# sample, via SharpDx, so that I can use it to give my backgrounds a dynamic lighting effect. I’ve said many times before your applications background is vital to the overall UX of your application, applying effects such as lighting to it is just one of may great tools now available to us in the metro managed world
1. Here’s a screen shots of the demo
This is the Home screen (below) where you can launch the 2 types of demos
This first demo (below) is using a SwapChainBackgroundPanel to render the lighting effects on
This second demo (below) is using the SurfaceImageSource to render the lighting effects on
2. Here is a video of the Xaml/C#/SharpDx sample in action :
3. Here is the source code :
4. Conclusion :
Now that WinRT/XAML promises a GPU optimized experience we should take advantage of that particularly to give our applications an advantage over others.
We want the best UI/UX and I strongly believe that applying things such as effects to our apps will give us that, of course they need to be applied in a tasteful and optimized/performant manner
Lighting effects are awesome, especially if they’re done on your apps background and animates organically over time to give your app the feeling of being alive and responsive. I can’t wait to use this in my future apps!