Shader "ScreenWater" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Field ("Field Channel", 2D) = "black" {}
_Flow ("Flow", 2D) = "black" {}

}

SubShader {
Pass {
ZTest Always Cull Off ZWrite Off Fog { Mode off }

CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"

struct v2f {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};

uniform sampler2D _MainTex;
sampler2D _Field;
sampler2D _Flow;
half _Speed;
half _Intens;

v2f vert (appdata_img v)
{
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv = MultiplyUV (UNITY_MATRIX_TEXTURE0, v.texcoord);

return o;
}

half4 frag (v2f i) : COLOR
{

float t = _Time.x * _Speed;

float2 coor = i.uv ;

half4 flow = tex2D (_Flow,coor + t);

half4 fc = tex2D(_Field, i.uv) * flow;

half4 distort = fc * _Intens ;

return tex2D(_MainTex, i.uv + distort );
}

ENDCG
}
}

Fallback off

}

Unity Flow distort of screen的更多相关文章

  1. unity share current game screen

    using UnityEngine; using System.Collections; using UnityEngine.UI; using System.IO; public class Tak ...

  2. 在Unity中实现屏幕空间反射Screen Space Reflection(4)

    第四部分讲一下如何在2D屏幕空间步进光线. http://casual-effects.blogspot.com/2014/08/screen-space-ray-tracing.html 中的代码感 ...

  3. screen space shadowmap unity

    unity用到了screen space shadow map 1.camera 在light pos 生成depth1 2.screen space depth2 3.根据depth1 depth2 ...

  4. BEST FREE UNITY ASSETS – OVER 200 CURATED QUALITY ASSETS

    http://www.procedural-worlds.com/blog/best-free-unity-assets-categorised-mega-list/ BEST FREE UNITY ...

  5. Unity-WIKI 之 AnimationToPNG

    组件功能 把3D角色的动画录制成PNG一帧一帧输出,这是一个件多么美好的事! 可能遇到问题 有可能当你新建完脚本时会出现下面的错误: `System.IO.File' does not contain ...

  6. Unity3D用户手册

    Unity Manual 用户手册 Welcome to Unity. 欢迎使用Unity. Unity is made to empower users to create the best int ...

  7. emacs org-mode文件转html文件

    Table of Contents 1. 发布站点 by emacs org-mode 1.1 org-mode 自带的导出方法 1.2 批量导出 1.3 css 美化 1.4 导出html 1. 发 ...

  8. SAP 实例 5 CFW Events

    REPORT demo_custom_control . * Declarations ***************************************************** CL ...

  9. CREATE A LOADING SCENE / SPLASH SCREEN - UNITY

    In the first scene or maybe the Main Menu scene of your game Create an Empty Gameobject. Call it wha ...

随机推荐

  1. Invalid segment BIN$xxx and dba_recyclebin was empty (回收站空,释放无效的BIN$xx空间)

    近来有套库空间紧张,发现有很大BIN$开头的TABLE partition,index partition 类型的段,查询确认是2个月前删除的对象,手动清空过dba_recyclebin使用purge ...

  2. 新安装 wampserver 出现 You don't have permission to access / on this server. 或者访问数据库出现You don't have permission to access /phpmyadmin/ on this server.(解决方法)转

    本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on ...

  3. CSS jQuery HTML5 CSS3

    jquery css3图片文字介绍鼠标滚动页面动画单页 http://www.17sucai.com/preview/1/2013-12-30/%E5%8A%A8%E7%94%BB%E5%8D%95% ...

  4. 【工具篇】source Insight

    不多说,阅读代码利器. 一.修改背景颜色 使用淡绿色更护眼(听说而已),菜单“选项”>>“属性”,使用自己喜欢的颜色吧.我的淡绿色RGB是181,236,207 二.行号,空格替换tabs ...

  5. php实现无限级树型菜单(函数递归算法)

    首先到数据库取数据,放到一个数组,然后把数据转化为一个树型状的数组,最后把这个树型状的数组转为html代码.也可以将第二步和第三步合为一步. 详细如下:1.数据库设计:脚本如下:CREATE TABL ...

  6. excel 无法打开文件,提示:向程序发送命令时出现问题

    以下的方法以Excel为例,请一个一个的使用,总会有一个适合你的. 1 .兼容性 鼠标右击桌面Excel(或其他)的快捷方式,选“兼容性”,把以管理员身份运行此程序前的勾去掉,就一切ok 了. 如果桌 ...

  7. 帝国cms灵动标签调用tags

    这个语法用来调用[指定分类][指定条件]的所有tags [e:loop={"select * from [!db.pre!]enewstags order by num desc limit ...

  8. #Leet Code# LRU Cache

    语言:C++ 描述:使用单链表实现,HeadNode是key=-1,value=-1,next=NULL的结点.距离HeadNode近的结点是使用频度最小的Node. struct Node { in ...

  9. linux源码Makefile的详细分析

    目录 一.概述 1.本文的意义 2.Linux内核Makefile文件组成 二.Linux内核Makefile的“make解析”过程 1 顶层Makefile阶段 1.从总目标uImage说起 2.v ...

  10. ASP.NET MVC轻教程 Step By Step 7——改进Write动作方法

    在上一节我们使用强类型视图改进Write视图获得更好的智能感知和代码重构,现在可以进一步的改进动作方法. Step 1. 数据模型绑定 在Save方法中我们使用Request来获取表单传送的值,其实可 ...