Home OFC Tech (blog) WPF Shader Effects - Part I

WPF Shader Effects - Part I

E-mail Print

This article is kind of "Shader Effects for Dummies".  Or maybe more appropriately, "Shader Effects for people who don't really know **** about WPF".  So with that out of the way, here goes...

I got started by watching this video on YouTube that shows off a ton of custom transition effects for WPF.  If you'd like to incorporate some of these effects into one of your own WPF applications, there are a few gotchas that you are expected to figure out on your own.


  • Gotcha 1: You have to download the effect library source from Codeplex and compile the binaries yourself.  The source can be found here.
  • Gotcha 1a: The source on Codeplex won't compile cleanly. I had to make a code fix to line 38 of the Ripple.fx file in the effects library.  I changed: float falloff = saturate(1-distance); to: float falloff = 1-distance; per the screenshot below.

    Ripple
  • Gotcha 2: Once you add refererences to the shader effect libraries to your project, you have a whole new set of effects that you can choose from in Expression Blend.

    Effects

  • Gotcha 3: You really *really* should get comfortable with creating animations and using the built in render transform functionality in Expression Blend before trying to tackle your own programatic implementation of the Shader Effects library for the first time.  This is just my opinion, but once you see the XAML getting output as you add things to the Blend timeline, its much easier to concepualize your own implementation.  This video on YouTube is a provides a pretty clear explanation of what render trasformations do for you with WPF.

 


Stay tuned for part 2 of this series where I run through a couple examples of how to implement simple transitions programmatically.


blog comments powered by Disqus
Last Updated ( Friday, 19 March 2010 02:41 )  

ID Card Printing

WorkForce ID cards are custom designed to reflect you unique business, brand or identity. Click to view our product brochure

WorkForceID_Marketing_v1.11

We also have specific offerings tailored to small businesses and individual entrepreneurs.


Certifications

Oracle Partner Logo

MS Partner Logo

Our Partners

The Gravely Group
INCREASE CDC
ECDI - Columbus
DMW Computers

Our Products

Sample imageNeighborhood Shield Drive
WorkForce ID
My Property Tag

Our Services

Application Development
Website Design
Flash Multimedia Design
Ecommerce & Storefronts
Card Printing & Plastics