Unity Flow distort of screen
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的更多相关文章
- unity share current game screen
using UnityEngine; using System.Collections; using UnityEngine.UI; using System.IO; public class Tak ...
- 在Unity中实现屏幕空间反射Screen Space Reflection(4)
第四部分讲一下如何在2D屏幕空间步进光线. http://casual-effects.blogspot.com/2014/08/screen-space-ray-tracing.html 中的代码感 ...
- screen space shadowmap unity
unity用到了screen space shadow map 1.camera 在light pos 生成depth1 2.screen space depth2 3.根据depth1 depth2 ...
- 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 ...
- Unity-WIKI 之 AnimationToPNG
组件功能 把3D角色的动画录制成PNG一帧一帧输出,这是一个件多么美好的事! 可能遇到问题 有可能当你新建完脚本时会出现下面的错误: `System.IO.File' does not contain ...
- Unity3D用户手册
Unity Manual 用户手册 Welcome to Unity. 欢迎使用Unity. Unity is made to empower users to create the best int ...
- 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. 发 ...
- SAP 实例 5 CFW Events
REPORT demo_custom_control . * Declarations ***************************************************** CL ...
- 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 ...
随机推荐
- (转)META http-equiv="refresh" 实现网页自动跳转
***.html自动跳转文件代码如下: <HTML> <HEAD><META http-equiv="Refresh" content="5 ...
- 《你不常用的c#之一》:略谈unsafe
转自csdn:http://blog.csdn.net/robingaoxb/article/details/6199508 msdn里讲到: “在 C# 中很少需要使用指针,但仍有一些需要使用的情况 ...
- NFC简介
NFC简介 NFC是Near Field Communication缩写,即近距离无线通讯技术.由飞利浦和索尼公司共同开发的NFC是一种非接触式识别和互联技术,可以在移动设备.消费类电子产品.PC 和 ...
- Quartz.net 定时任务在IIS中未按时执行
IIS 垃圾回收机制下解决Quartz.net 的不执行问题 IIS中涉及了垃圾回收机制,quartz.net 在ASP.NET 项目中可以实现线程监控定时执行任务,但是在IIS7.5机一下版本中涉及 ...
- 状态CSS
<span style="background-color: #999999 !important;color:#FFFFFF;font-size: 11px;height: 18px ...
- Vim自动补全神器:YouCompleteMe(转)
转自:http://blog.jobbole.com/58978/ 可能会有一段时间写linxu,免不了用vim,留着,找时间实操之 原文出处: marchtea 的博客 第一次听说这个插件还是在偶然 ...
- mysql 中执行的 sql 注意字段之间的反向引号和单引号
如下的数据表 create table `test`( `id` int(11) not null auto_increment primary key, `user` varchar(100) no ...
- 最近采用Instruments
最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有 ...
- js常用字符串函数
// JS字符串 //1.replace字符串替换,只能换第一部分,就是说多个字符相同,只能换下最先的 var str='helloworld!'; alert(str.replace('llo',' ...
- ng-html 报 不安全 警告解决办法
app.filter('to_trusted',['$sce',function($sce){ return function(text){ return $sce.trustAsHtml(text) ...