블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-24 00:01

[파일]

Super-Blur-master.zip




[링크] https://github.com/PavelDoGreat/Super-Blur



Super Blur

Blur effect that you can apply on Camera and UI. Gaussian weights was taken from this project.

view

Usage

Just add SuperBlur.cs or SuperBlurFast.cs script to Camera and attach Blur Material and UI Material to it.

  • SuperBlur - (recommended way) It's using OnRenderImage to grab screen texture.

  • SuperBlurFast - Render scene directly to render texture. Much better perfomance on mobile devices, but doesn't work with other post effects.

Properties

editor

  • Render Mode - Chooses to render as Post Effect or just apply blurred texture to UI material.

  • Kernel Size - Bigger kernels produces bigger blur, but are more expensive.

  • Interpolation - Use if you want to create smooth blurring transition.

  • Downsample - Controls buffer resolution (0 = no downsampling, 1 = half resolution... etc.).

  • Iterations - More iterations = bigger blur, but comes at perfomance cost.

  • Gamma Correction - Enables gamma correction to produce correct blur in Gamma Colorspace. Disable this option if you use Linear Colorspace.

License

If you'd try to sell it on Asset Store, then I'm gonna find you.

See LICENSE for details.



반응형
Posted by blueasa
, |

SHADDERRRRS! Well that is it, I’m caught in shader land. The thing is, I don’t know jack **** about them. What I am missing mostly from Flash in Unity are filters like blur, drop shadow and glow. How you would go about doing that in Unity would be with shaders (I guess), so I stuck my nose in them. Here is my first version of a Blur filter/shader.

 

Shader "Unlit/Transparent Colored Blurred"
{
  Properties
  {
    _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {}
    _Distance ("Distance", Float) = 0.015
  }
 
  SubShader
  {
    LOD 100
 
    Tags
    {
      "Queue" = "Transparent"
      "IgnoreProjector" = "True"
      "RenderType" = "Transparent"
    }
 
    Cull Off
    Lighting Off
    ZWrite Off
    Fog { Mode Off }
    Offset -1, -1
    Blend SrcAlpha OneMinusSrcAlpha
 
    Pass
    {
      CGPROGRAM
      #pragma vertex vertexProgram
      #pragma fragment fragmentProgram
 
      #include "UnityCG.cginc"
 
      struct appdata_t
      {
        float4 vertex : POSITION;
        float2 textureCoordinate : TEXCOORD0;
        fixed4 color : COLOR;
      };
 
      struct vertexToFragment
      {
        float4 vertex : SV_POSITION;
        half2 textureCoordinate : TEXCOORD0;
        fixed4 color : COLOR;
      };
 
      sampler2D _MainTex;
      float4 _MainTex_ST;
      float _Distance;
 
      vertexToFragment vertexProgram (appdata_t vertexData)
      {
        vertexToFragment output;
        output.vertex = mul(UNITY_MATRIX_MVP, vertexData.vertex);
        output.textureCoordinate = TRANSFORM_TEX(vertexData.textureCoordinate, _MainTex);
        output.color = vertexData.color;
        return output;
      }
 
      fixed4 fragmentProgram (vertexToFragment input) : COLOR
      {
        float distance = _Distance;
        fixed4 computedColor = tex2D(_MainTex, input.textureCoordinate) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x + distance , input.textureCoordinate.y + distance )) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x + distance , input.textureCoordinate.y)) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x , input.textureCoordinate.y + distance )) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x - distance , input.textureCoordinate.y - distance )) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x + distance , input.textureCoordinate.y - distance )) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x - distance , input.textureCoordinate.y + distance )) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x - distance , input.textureCoordinate.y)) * input.color;
        computedColor += tex2D(_MainTex, half2(input.textureCoordinate.x , input.textureCoordinate.y - distance )) * input.color;
        computedColor = computedColor / 9;
 
        return computedColor;
      }
      ENDCG
    }
  }
}

It works ok, with a lot of restrictions. First, you can only use it for NGUI UITextures. I would love it to work with UISPrites, but they all share the same atlas, so if you blur one sprite you blur them all! Also, for now, you should leave a padding of 10 transparent pixels around your texture for a better effect.
 

ShaderBlurred

The Distance parameter is relative to the size of your texture so correct values will change from one texture to the other. Anyway you have it, I will keep working on it, but if you see anything that can be improved, don’t be afraid to tell me, I would really like to make it better.



[출처] http://www.zedia.net/2013/blur-filter-for-uitexture-in-ngui/

반응형
Posted by blueasa
, |

SourceTree가 Windows에서 너무 느려서 찾아 보다가, 

개선책이 보여서 적용해보고 괜찮아 진 것 같아서 정리해 놓음.




down voteaccepted

I know this is an old question, but you could also try this:

http://stackoverflow.com/a/24045966/371917

$ git config --global core.preloadindex true
$ git config --global core.fscache true
$ git config --global gc.auto 256

Secondly, here is a post that explains that git gc --aggressive may not be a great idea.


아래 [참조1] 링크에 보면 위와 같이 git config을 셋팅하라고 나온다.


근데 Windows 버전이면 어딘가 있을 것 같아서 찾아보니


SourceTree 우측 상단 Setting-Edit Config... 을 눌러보면 해당 설정과 관련있는 옵션들([core])이 나온다.

aggressive 옵션은 어떻게 넣어야 될지 모르겠으니 우선 패스하고,

3개 옵션이 안보여서 다른 옵션 보고 형식에 맞게 직접 추가했다.


[core]

repositoryformatversion = 0

filemode = false

bare = false

logallrefupdates = true

symlinks = false

ignorecase = true

hideDotFiles = dotGitOnly

preloadindex = true

fscache = true

[gc]

auto = 256



좀 더 지켜봐야 겠지만 계속 느끼던 렉이 사라진 것 같다. (만세!! -ㅁ-!!)




[참조1] http://stackoverflow.com/questions/28105472/sourcetree-very-slow-with-many-repositories

[참조2] https://believeinmiraclesx.wordpress.com/2015/11/13/sourcetree-is-very-slow-in-windows/

[참조3] https://answers.atlassian.com/questions/10413451/sourcetree-slow-in-windows-7-x64...

반응형
Posted by blueasa
, |