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. Java MD5校验

    Java 生成MD5 MD5(Message Digest Algorithm),消息摘要算法,一般用于校验文件的完整性.Java内置已经实现了MD5,与SHA1算法,利用java.security. ...

  2. C# 控制台程序 托盘图标 事件响应

    static void Main(string[] args) { NotifyIconHelper ni = new NotifyIconHelper(); NotifyIconHelper.Sho ...

  3. Linq 构造复杂Json 多表group by

    一个主表A(a1,a2),子表B(a1,b1,b2) ,想得到的结果是 [{a1,a2,Info [{b1,b2},{b1,b2},...}]] var list= from a in A join ...

  4. nodejs框架express4.x 学习--安装篇

    一.安装建立项目 1.安装nodejs 2.安装express(全局) npm install -g express 默认安装的是4.12.4 3.由于在3.6版本之后项目构建器被单独拆分出来,所以还 ...

  5. Windows phone 之Socket

    服务器端: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sy ...

  6. php利用时间生成随机函数

    date("YmdHis",time()); rand();    生成随机数   当括号内无参数时 系统会以当前时间为种子进行随机数的生成 rand(1,10);  括号里面是生 ...

  7. muduo网络库学习笔记(10):定时器的实现

    传统的Reactor通过控制select和poll的等待时间来实现定时,而现在在Linux中有了timerfd,我们可以用和处理IO事件相同的方式来处理定时,代码的一致性更好. 一.为什么选择time ...

  8. QML之TextEdit

    TextEdit显示一个可编辑的,有格式的文本框.它也可以显示明文和富文本.例如:TextEdit {    width: 240    text: "<b>Hello</ ...

  9. 移除Sourcesafe与VC6的绑定

    整理日: 2015年2月16日 HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Source Control\Disabled

  10. (转载)KL距离,Kullback-Leibler Divergence

    转自:KL距离,Kullback-Leibler Divergence   KL距离,是Kullback-Leibler差异(Kullback-Leibler Divergence)的简称,也叫做相对 ...