[펌] [Unity, NGUI, Shader] Transparent Colored Blur shader
So I had some spare time to study things I've always wanted to.
Left: Default shader // Right: Blur shader
Note:
All shader files (including the files with number suffix) must be downloaded together.
The numbers represent the clipping panel count when using Soft Clip on UIPanel components.
Refer to: http://www.tasharen.com/forum/index.php?topic=13985.0
You can customize the amount of blurring by editing the two fields below.
iterations variable represents the radius.
blurSize variable represents the scale (in UV coordinate) which the other pixel should be sampled from.
It should be possible to expose these fields so you can mess around with them through Materials or C# scripts.
half blurSize = 0.005; half iterations = 4;
Limitations:
Originally I wanted to implement a Gaussian Blur effect but it's quite complicated and expensive.
So it ended up in a sort of "hack" by blurring the pixels in horizontal and vertical axis only.
While it may look fine on low iteration count, it doesn't take the diagonal pixels in to calculation, making high radius blurs look unnatural.
I am planning to make another workaround for this issue some time.
[출처] m.blog.naver.com/reisenmoe/221268044207
'Unity3D > Shader' 카테고리의 다른 글
[펌] Toon Shader (0) | 2021.03.30 |
---|---|
[링크] Unity Cel Shading - 카툰렌더링 (0) | 2021.03.30 |
[펌] Photoshop Blend Modes Without Backbuffer Copy (0) | 2020.12.14 |
[링크] 쉐이더 코드 사이트 (0) | 2020.06.18 |
[Link] Rim lighting and realtime shadows for sprites in Unity (2D) (0) | 2019.08.19 |