1 / 32

What's N ew in S ilverlight 3 : GRAPHICS

What's N ew in S ilverlight 3 : GRAPHICS. Andy Beaulieu MCT, MCSD.NET WPF + Silverlight Insiders MVP Client App Dev www.andybeaulieu.com | www.spritehand.com. About Me. Andy Beaulieu Based in Syracuse, NY MCT, MCSD.NET Microsoft MVP Client App Dev WPF & Silverlight Insiders

boyd
Download Presentation

What's N ew in S ilverlight 3 : GRAPHICS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What's New inSilverlight 3:GRAPHICS Andy Beaulieu MCT, MCSD.NET WPF + Silverlight Insiders MVP Client App Dev www.andybeaulieu.com | www.spritehand.com

  2. About Me • Andy Beaulieu • Based in Syracuse, NY • MCT, MCSD.NET • Microsoft MVP Client App Dev • WPF & Silverlight Insiders • Full-time Developer, Part-time Trainer • .NET Community: • Speaker at User Groups, Code Camps, Conferences • User Group Leader - www.cnydevelopers.net • INETA Volunteer • Blog and Creations: • www.andybeaulieu.com • www.spritehand.com

  3. Agenda • Perspective 3D • Effects (aka Pixel Shaders) • GPU Acceleration (Cached Composition) • Bitmap API • Animation Easing • H264 Video Support

  4. About Silverlight 3 • IN BETA 1 • NO GO-LIVE License • Released at MIX Conference on 3/18/2009 • http://silverlight.net/getstarted/silverlight3/default.aspx • Release Date? • Unknown • NO MULTI-TARGETING SUPPORT • Use a VirtualPC, Separate Box, or Hacks Available

  5. Is silverlight 3 the holy grail?

  6. FOR 2D GRAPHICS OR VIDEO GPU ACCELERATION VIDEO SUPPORT Is silverlight 3 the holy grail?

  7. FOR BUSINESS DEVELOPERS TEXT RENDERING .NET RIA SERVICES Is silverlight 3 the holy grail?

  8. MAJOR ISSUES? PRINTING SUPPORT BROWSER PENETRATION BROWSER REACH Is silverlight 3 the holy grail?

  9. Perspective 3D • PlaneProjection • Allows 2D Content to be rotated in 3D space RotationX

  10. Perspective 3D • PlaneProjection: Property Element Syntax • Common Properties • Rotation X, RotationY, RotationZ • GlobalOffsetX, GlobalOffsetY, GlobalOffsetZ

  11. DEMO: Perspective 3d

  12. Effects (aka Pixel Shaders) • Modify Displayed Pixels of any UI Element • Two Effects Available Out-of-the-Box in SL3: • Blur • DropShadow • Currently done in SOFTWARE (slow) • Maybe someday in Hardware

  13. DEMO: EFFECTS (pixel shaders) Blur and dropshadow

  14. Effects (aka Pixel Shaders) • We can Create our own CUSTOM Pixel Shader Effects! • Created using High Level Shader Language (HLSL) • HLSL + Shaders exist in DirectX and WPF • Lots of samples of HLSL around web • Shazzam! • Nice real-time editing tool • http://www.shazzam-tool.com/

  15. DEMO: CUSTOM EFFECTS (pixel shaders)

  16. DEMO: CUSTOM EFFECTS (pixel shaders)AND perspective 3d (MIX demo)

  17. GPU Acceleration • Final Draw done using GPU • GPU Can be Video Card or On-board (90% of PCs) • Blending, Transforms, or Rectangular Clipping also done by GPU • BIG performance boost

  18. GPU Acceleration, cont’d • Supported on both Mac and PC • Mac uses OpenGL • PC uses DirectX • Some Browsers on Mac (ie Safari) only allow OpenGL in Full Screen Mode!

  19. GPU Acceleration • How to Enable (PART 1): • Must enable at the PLUG-IN LEVEL:

  20. Bitmap Caching • Useful for speeding up graphics that DO NOT change (do not rotate, animate, etc.) • Video Card will handle drawing of UI Element • Example: scrolling backgrounds, background elements, etc. • Requires GPU Acceleration is turned on • How to Enable Bitmap Caching: • Add CacheMode="BitmapCache“ attribute to each UI Element that you want Bitmap Cached

  21. DEMO: GPU acceleration

  22. GPU Acceleration • Debugging GPU Acceleration • How can we tell what is being cached successfully? • Set the EnableCacheVisualization property to “true” in the plug-in initialization • Any NON-Cached surface will be tinted a color. • BE CAREFUL OF SURFACE SIZE. • On older machines, a surface > 2048 pixels in height or width will disable caching.

  23. DEMO: DEBUGGING GPU ACCELERATION

  24. Bitmap API • Allows you to create Bitmap’s in Silverlight • Useful for: • Paint Programs • Emulators • Fractal Generators • Can also take “snapshot” of Silverlight UI into Bitmap • Perhaps load to server for inclusion in a Report?

  25. Bitmap API • LIMITATIONS IN SILVERLIGHT 3 BETA • Cannot access Pixels after calling Render() • Due to Security constraints • (imagine a malicious Silverlight App reading images off your Bank website and sending them up to a server) • Hopefully fixed by Release Time!

  26. Bitmap API, cont’d • How to use

  27. DEMO: bitmap API

  28. Animation Easing • Makes it easy to add lifelike manner to animations • Easily add basic physics to StoryBoard animation • Saves you creating StoryBoard key frames by hand

  29. DEMO: Animation easing

  30. H.264 Video Support • H.264 == MPEG-4 • Many consider this “The Internet Video Standard” • Good Quality @ Lower Bit Rates • Can use Expression Encoder 2 to encode to MPEG-4 • Need Encoder Service Pack 1, from MS Download!

  31. DEMO: H.264 VIDEO SUPPORT

  32. QUESTIONS? www.andybeaulieu.com | www.spritehand.com

More Related