Silverlight 3 introduces the GPU acceleration feature

Source: Internet
Author: User

Silverlight 3 introduces the GPU acceleration feature, which is disabled by default. To enable this function, you must:

1. Set <param name = "enableGPUAcceleration" value = "true"/> On Silverlight plug-in.Or use code Application.Current.Host.Settings.EnableGPUAcceleration= True;

2. Set it on the control with the UIElement typeCacheMode = "BitmapCache"-GPU acceleration caches some UI elements based on GPU, saving CPU usage.

How do I know which controls are cached? Set on Silverlight plug-in< param name = "enableCacheVisualization" value = "true" /> The color changes on the program interface:

1. Red indicates no cache

2. The normal color indicates that the image is cached.

3. Green indicates no settingCacheMode = "BitmapCache", but automatically cached

Because GPU acceleration is based on caching, the frequently changed UIElement is not suitable for use, because frequent cache updates may result in performance loss. However, MideaElement, for example, performance improvement can be achieved by using GPU acceleration for video frequency:

Figure: video with cache Enabled

However, perspetive 3d videos cannot:

Figure: the video on the right uses the Pespective 3d effect, which is displayed in red and has no cache.


Restrictions on GPU acceleration:

1. GPU acceleration only supports the following animations: Scale, Rotate, Changing Opacity, Clipping (only if clip is rectangular), and others are not supported, such as Perspective 3d effect animation.

2. if the GPU memory is insufficient, Silverlight uses the CPU to implement cache by default, which increases the CPU burden. Currently, Silverlight does not support querying the GPU cache size, and only provides Analytics. gpuCollection attributes.


3. You need to support DirectX (Windows) or OpenGL (Mac) graphics cards, and Mac only supports full screen mode

Refer:

1. https://blogs.msdn.com/ B /rahul/archive/2010/06/09/silverlight-graphics-and-hardware-acceleration.aspx

2. http://dotnetslackers.com/articles/silverlight/discovering-silverlight3-deep-dive-into-gpu-acceleration.aspx

3. http://arthraim.cn/silverlight-3-and-gpu-acceleration/

Dress up games
Game Change
Makeup games
Beauty games

 

Original article: http://blog.csdn.net/jameszhou/archive/2010/06/14/5670852.aspx

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.