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