惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
博客园_首页
T
Threatpost
S
Secure Thoughts
月光博客
月光博客
S
Schneier on Security
爱范儿
爱范儿
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
Microsoft Azure Blog
Microsoft Azure Blog
L
LINUX DO - 热门话题
C
Cyber Attacks, Cyber Crime and Cyber Security
大猫的无限游戏
大猫的无限游戏
Cyberwarzone
Cyberwarzone
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
C
CERT Recently Published Vulnerability Notes
Project Zero
Project Zero
P
Proofpoint News Feed
B
Blog
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
G
GRAHAM CLULEY
S
Securelist
K
Kaspersky official blog
Spread Privacy
Spread Privacy
Stack Overflow Blog
Stack Overflow Blog
Security Latest
Security Latest
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
I
Intezer
NISL@THU
NISL@THU
The Register - Security
The Register - Security
P
Privacy International News Feed
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Tenable Blog
AI
AI
V2EX - 技术
V2EX - 技术
量子位
Jina AI
Jina AI
博客园 - Franky
N
News | PayPal Newsroom
Cloudbric
Cloudbric
N
News and Events Feed by Topic
J
Java Code Geeks

博客园 - _Sin

UnityGUI扩展实例:图片挖洞效果 Mask的反向实现 how to combine jpg + separate alpha in png? Unity Shader Billboard Unity Shaders Vertex & Fragment Shader入门 Unity3d三大光照渲染介绍 unity3d DefineManager 全局宏定义 Jenkins 搭建U3D自动发布 IOS Jenkins 搭建U3D自动发布 Android Color Space Max批量导出工具 手游比重 不得不存!UI设计新手不可错过的7条实用法则 Unity3D游戏在iOS上因为trampolines闪退的原因与解决办法 [Unity3D]引擎崩溃、异常、警告、BUG与提示总结及解决方法 unity3d ngui 字体制作 工具与示例 幽默的理解六种Socket I/O模型 Unity3d Socket C# sourecode Flex与c# Socket通信 C# 解析JSON数据格式 Mono 源码
unity 全屏乱影 BlitMultiTap
_Sin · 2015-06-01 · via 博客园 - _Sin

http://m.blog.csdn.net/blog/stalendp/40859441

官方例子AngryBots的链接地址:http://u3d.as/content/unity-technologies/angry-bots/5CF

《Unity Shaders and Effects Cookbook》的章节:

Chapter 10 Screen Effects with Unity Render Textures

Chapter 11 Gameplay and Screen Effects

[GPU Gems] Real-Time Glow:http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html

using UnityEngine;
[ExecuteInEditMode]
public class _MultiTap_y: MonoBehaviour
{
public GUISkin skin;
public string[] labels;
public Rect[] rLabels;
public float[] vals;
public Rect[] rSliders;
public Material myMat;
void OnGUI()
{
GUI.skin = skin;
for (int i = 0; i < labels.Length; i++)
{
GUI.Label(rLabels[i], labels[i]);
}
vals[0] = GUI.HorizontalSlider(rSliders[0],vals[0],-8f,8f);
}
void OnRenderImage (RenderTexture src, RenderTexture dst)
{
Graphics.BlitMultiTap(src,dst,myMat,
new Vector2(vals[0],vals[0]),
new Vector2(vals[0],vals[0])
);
}
}

//====================

Shader "Tut/Effects/ConeTap_0y" {
Properties {
_MainTex ("", 2D) = "white" {}
}
Subshader {
ZTest Always Cull Off ZWrite Off Fog { Mode Off }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"

struct v2f {
float4 pos : POSITION;
half4 uv[2] : TEXCOORD0;
};
float4 _MainTex_TexelSize;
float4 _BlurOffsets;
v2f vert (appdata_img v)
{
v2f o;
float offX = _MainTex_TexelSize.x * _BlurOffsets.x;
float offY = _MainTex_TexelSize.y * _BlurOffsets.y;

o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
float2 uv = MultiplyUV (UNITY_MATRIX_TEXTURE0, v.texcoord.xy-float2(offX, offY));

o.uv[0].xy = uv + float2( offX, offY);
o.uv[0].zw = uv + float2(-offX, offY);
o.uv[1].xy = uv + float2( offX,-offY);
o.uv[1].zw = uv + float2(-offX,-offY);
return o;
}
sampler2D _MainTex;
fixed4 frag( v2f i ) : COLOR
{
fixed4 c;
c = tex2D( _MainTex, i.uv[0].xy );
c += tex2D( _MainTex, i.uv[0].zw );
c += tex2D( _MainTex, i.uv[1].xy );
c += tex2D( _MainTex, i.uv[1].zw );
return c/4.0;
}
ENDCG
}
}
Fallback off
}