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

推荐订阅源

V
Vulnerabilities – Threatpost
V
V2EX
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
Y
Y Combinator Blog
C
Check Point Blog
爱范儿
爱范儿
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
美团技术团队
雷峰网
雷峰网
IT之家
IT之家
WordPress大学
WordPress大学
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
N
News and Events Feed by Topic
罗磊的独立博客
S
SegmentFault 最新的问题
S
Security Affairs
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
H
Hacker News: Front Page
Google DeepMind News
Google DeepMind News
B
Blog
O
OpenAI News
C
Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
Hacker News: Ask HN
Hacker News: Ask HN
博客园_首页
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Help Net Security
Help Net Security
月光博客
月光博客
J
Java Code Geeks
L
LangChain Blog
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - _Sin

UnityGUI扩展实例:图片挖洞效果 Mask的反向实现 how to combine jpg + separate alpha in png? unity 全屏乱影 BlitMultiTap 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 Shader Billboard
_Sin · 2015-06-01 · via 博客园 - _Sin

记录来源于ShaderLab开发实战详解

Shader "Tut/Project/Billboard_1" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
pass{
Cull Off
ZTest Always
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
struct v2f {
float4 pos:SV_POSITION;
float2 texc:TEXCOORD0;
};
v2f vert(appdata_base v)
{
v2f o;
float4 ori=mul(UNITY_MATRIX_MV,float4(0,0,0,1));
float4 vt=v.vertex;
vt.y=vt.z;//这个平面是沿xz平面 展开的
vt.z=0;//所以只关心其平面上的信息

//通过加上Object Space的原点在ViewSpace的信息,保持其透视大小
vt.xyz+=ori.xyz;//result is vt.z==ori.z ,so the distance to camera keeped ,and screen size keeped
o.pos=mul(UNITY_MATRIX_P,vt);

o.texc=v.texcoord;
return o;
}
float4 frag(v2f i):COLOR
{
return tex2D(_MainTex,i.texc);
}
ENDCG
}//endpass
}
}