Lighting Effects in your XAML/C# metro apps :)


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 Smile


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 Smile

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!

14 responses to “Lighting Effects in your XAML/C# metro apps :)

  1. Pingback: Lighting Effects in your XAML/C# metro apps :) | Silverlight and other cool things …

  2. Pingback: Windows 8 Developer Links – 2012-04-13 | Dan Rigby

  3. Pingback: Custom Effects – Ripple Effect (Pixel Shader) | Silverlight and other cool things …

  4. Pingback: All my XAML/C#/SharpDx demos | Silverlight and other cool things …

  5. This looks great. You should update your demo to the Release Preview.

  6. Yes, please update it to the Release Preview.
    thanks a lot for your help

  7. I have read so many articles regarding the blogger lovers but this paragraph is
    really a good post, keep it up.

  8. I have seen a powerful sober man driven perfectly mad for now by two glasses
    of so-called rum, supplied to him at one of them shanties. After shooting for about two minutes and a half, he pulled the trigger.
    On the Early days with the Peak Downs Field from “The Peak Downs Telegraph”.

  9. What’s up mates, how is everything, and what you would like to say regarding this piece of writing, in my view its really amazing designed for me.

  10. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get
    three e-mails with the same comment. Is there any way you
    can remove me from that service? Bless you!

  11. Hi, i feel that i noticed you visited my site so
    i came to return the want?.I am attempting to in finding things to improve my
    website!I suppose its adequate to use some of your ideas!

  12. Bottom-line: Best choice if you’re a moderate downloader of course, if torrents are throttled or banned for you. Either visually or using your hands, move all limiting energy off and in the sponge. And she is into the Dan and Nate “who should I choose” duel unknowingly.

  13. Let’s do it. You’ll save several pennies about the
    power bill and it’ll be pretty challenging to hack an invisible network that is not online. Most phishing emails are pretty poorly made.

  14. The download The Debt DVD rip that is certainly still standing
    is an oddity. –LINK REMOVED –>Grammy Nominations 2011<. As the atmosphere began to disintegrate around me, I felt a fresh strength forge into my thoughts.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s