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. 如何写robots.txt?

    robin 发表在 八月 2, 2006 在国内,网站管理者似乎对robots.txt并没有引起多大重视,应一些朋友之请求,今天想通过这篇文章来简单谈一下robots.txt的写作. robots.t ...

  2. 《你不常用的c#之一》:略谈unsafe

    转自csdn:http://blog.csdn.net/robingaoxb/article/details/6199508 msdn里讲到: “在 C# 中很少需要使用指针,但仍有一些需要使用的情况 ...

  3. IOC容器 - Autofac概述

    Autofac是比较出名的Ioc容器之一,熟悉Orchard的应该熟知.本文直接介绍autofac用法 一.开始 1.NuGet添加或者直接http://code.google.com/p/autof ...

  4. js 保留小数位数

    eg: var num=3.1415926 小数位处理:num.toFixed(n)      n:小数位数

  5. javascript 学习笔记之JQuery中的Deferred对象

    Deffered是Jquery中的一个非常重要的对象,从1.5版本之后,Jquery中的ajax操作都基于Deffered进行了重构,这个对象的处理模式就像其他Javascript框中的Promise ...

  6. HTML5-javascript屏幕旋转事件:onorientationchange

    屏幕旋转事件:onorientationchange 添加屏幕旋转事件侦听,可随时发现屏幕旋转状态(左旋.右旋还是没旋) 判断屏幕是否旋转 function orientationChange() { ...

  7. 网站商务通链接快速标识v1.0.js

    js代码为: function getSwt(keys){ try{ if(openZoosUrl&&typeof(openZoosUrl)=="function" ...

  8. ASP.Net Web 点击链接直接下载 不在浏览器打开

    目标是:用户点击链接直接弹出下载框,不在浏览器打开文件. 一般网站下载的功能,本以为直接把虚拟路径赋值给链接就行了,没想到测试的时候发现图片,文本和PDF格式的文件都自动在Firefox里面打开了,没 ...

  9. PM【terminal】

    More Knowledge More Performance More Time 资料模组化 以知识管理为基础的项目管理 规范:ethic

  10. OC语言-01类和对象

    // cc 文件名.m -framework Foundation 编译链接 #import <Foundation/Foundation.h> //枚举性别 typedef enum{ ...