GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - garsonlab/UnityShaderRepository: 各种自己写的与使用过的UnityShader效果

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
Assets
Assets
 
 
ProjectSettings
ProjectSettings
 
 
UnityPackageManager
UnityPackageManager
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

Unity Shader Repository

Use Unity Version > 5 当前使用Unity版本大于5

Table of Contents

[TOCM]

1. Forge 雾效

1.1

2. Mask 裁剪

2.1 Rotate Mask 旋转裁剪

    fixed4 frag (v2f i) : COLOR
    {
        float2 center = float2(_CenterX, _CenterY);//自定义旋转中心点
        float2 uv = i.uv.xy - center;//当前点对应中心点的相对坐标
        // 旋转矩阵的公式: (cos - sin, sin + cos)顺时针
        float cosVal = cos(_RotateSpeed*_Time.y);
        float sinVal = sin(_RotateSpeed*_Time.y);
        uv = mul(uv, float2x2(cosVal, -sinVal, sinVal, cosVal)) + center;

        fixed4 color = tex2D(_MainTex, i.uv.xy)*_Color;
        color.a = color.a * tex2D(_MaskTex, uv).a;//用MaskTex的a做裁剪
        return color;
    }

2.2 Rect Soft Mask 矩形软裁剪

    if (_UseClipRect) 
    {
        //根据世界坐标计算,源自NGUI
        float2 factor = float2(0.0,0.0);
        float2 tempXY = (i.worldPos.xy - _ClipRect.xy)/float2(_SoftClipLeft, _SoftClipBottom)*step(_ClipRect.xy, i.worldPos.xy);
        factor = max(factor,tempXY);
        float2 tempZW = (_ClipRect.zw-i.worldPos.xy)/float2(_SoftClipRight, _SoftClipTop)*step(i.worldPos.xy,_ClipRect.zw);
        factor = min(factor,tempZW);
        color.a *= clamp(min(factor.x,factor.y),0.0,1.0);
    }

2.3 Custom Soft Mask 自定义形状软裁剪,支持反转

Mask need Component "Rect Mask 2D" in parent, Only one DrawCall. Base on .

3 Toon 卡通

3.1 Source from Candycat1992

3.2 ToonShading

4 Rain Effect 雨效

4.1 Souce from RainDropEffect

5 Grey Effect 灰度化效果

5.1 Image Grey, Support UGUI Mask and RectMask2D 图片灰度化,支持UGUI的Mask和RectMask2D下有效

5.2 Grey Effect, can reserve a Rect color window. Can use on Image and Camera effect.

5.3 Modify Image Grey, support animation. 修改图片灰度化,支持混合模式及缓动灰度化效果

6 Particle Mask 粒子裁剪

6.1 See This, Particle Mask

7 Rounded Rect 圆角矩形

8 Distortion 扭曲失真

参考

9 Breath 呼吸

About

各种自己写的与使用过的UnityShader效果

Resources

Readme
Activity

Stars

32 stars

Watchers

3 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.