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

推荐订阅源

WordPress大学
WordPress大学
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
量子位
A
About on SuperTechFans
G
Google Developers Blog
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - _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
}