Efficient Gaussian Blur

Description

Get the gaussian blur texture with the high efficiency way, it's no sharder program and run well in mobile platform(You can find many blur Shader programs in the web,they are both work perfect in PC but bad performance in mobile).And it's so easy to use,just add the component to the prefab.Both sopport UGUI and NGUI.


Usage scenario

Pop a child window from a scene from main scene, you want a child window with the background turn into gaussian blur.you just need to add the EfficientGaussianBlur component to child window prefab. So easy!


Quick start

   1.useage for UGUI only

     a. On the panel or the message box,you add the a GameObject as a background RawImage,Add Component -> EfficientGaussianBlur to that gameojcet,it will add the RawImage with the gaussian blur texture component automatic.And you must make sure other UI above on it.As below, the "GaussianBlur" GameObject is the first position of the MessageBox



   2.useage for NGUI only

     a. You must imported the NGUI plugin by yourself, or else you should use UGUI mode.

     b. Add the 'NGUI' macro switch to NGUI mode.In Unity, File -> Build Settings... -> Other Settings -> Scripting Define Symbols, Add the 'NGUI' into it.






     c. On the panel or the message box,you add the a GameObject as a background UITexture,Add Component -> EfficientGaussianBlur to that gameojcet,it will add the UITexture with the gaussian blur texture component automatic.Just replace RawImage with the UITexture by NGUI.And you must make sure other UIWidget's Depth above on it.



EfficientGaussianBlur Properties

1 "Scale":To be more high efficiency,we take less pixel info to blur texture.The number is bigger,then the texture is more blur, and take less CPU computing time.In CPU consum time,Number 1 take 64 times than Number 8, and Number 1 take 100 times than Number 10.Number 8 is recommend, or bigger.

2 "Alpha Time":tween blur time.You can set to -1 if you want to blur immediately.0.5 seconds is default.


Screenshots

1 before gaussian blur of the main scene.


2 scale 8 gaussian blur of the child window.


3 scale 16 gaussian blur of the child window.


Back to Top Contact me: 465583519@qq.com