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 ...
随机推荐
- Oralce9 的新方法: Merge into Using
一.语义 MERGE语句是Oracle9i新增的语法,用来合并UPDATE和INSERT语句.通过MERGE语句,根据一张表或子查询的连接条件对另外一张表进行查询,连接条件匹配上的进行UPDATE,无 ...
- iOS 十六进制的相加取反
ios中将NSstring字符串转换成char类型 NSString *string = [NSString stringWithFormat:@"5D"]; const char ...
- jax-ws实现WebService
关于WebService有很多框架了,CXF,Spring自己的webservice等等,因为cxf实际也是依赖spring的servlet,这里说明一下jax-ws,使用原生的servlet实现. ...
- 回退符\b
回退符\b #include <stdio.h> int main(){ printf("hello\b"); getchar(); getchar(); ; } 实验 ...
- 【HDU1402】【FFT】A * B Problem Plus
Problem Description Calculate A * B. Input Each line will contain two integers A and B. Process to e ...
- asp.net treeview控件无刷新选择和删除节点的ajax方法
转载 http://blog.csdn.net/luq885/article/details/1621681 如果节点被选择的话,节点所在的td的class属性就会被设置为TreeView1_1. ...
- 【elasticsearch】(3)centos7 安装中文分词插件elasticsearch-analyzer-ik
前言 elasticsearch(下面简称ES,安装ES点击这里)的自带standard分词只能把汉语分割成一个个字,而不能分词.分段,这就是我们需要分析器ik的地方了. 一.下载ik的相应版本 查看 ...
- 关于abbr 的一些用法
<span style="margin: 20px;">位 000置:</span><abbr title='四川省绵阳市梓潼县文昌镇金龙乡一大队二组 ...
- gooflow0.6的流程设计
为何使用gooflow:1.兼容性好 2.扩展点很多可以个性化设计 3.配有api文档 4.json格式的数据传输 gooflow0.8版 由于最近项目需要,急需设计一个流程,考虑到时间问题,和用户个 ...
- 【随记】还原SQL Server数据库步骤
情景:在一台机器上备份数据库,然后在另一台机器上还原数据库,可能会出现错误提示:System.Data.SqlClient.SqlError: 备份集中的数据库备份与现有的 'XXX' 数据库不同. ...